mirror of
https://github.com/SabreTools/SabreTools.IO.git
synced 2026-09-22 22:56:13 +00:00
Fix bitstream read naming again
This commit is contained in:
@@ -34,11 +34,11 @@ namespace SabreTools.IO.Test.Streams
|
||||
[Theory]
|
||||
[InlineData(4, 0b00000101, 1)]
|
||||
[InlineData(9, 0b10101010_1, 2)]
|
||||
public void ReadBitsLETest(int bits, uint expected, int position)
|
||||
public void ReadBitsBETest(int bits, uint expected, int position)
|
||||
{
|
||||
byte[] data = [0b01010101, 0b01010101, 0b01010101, 0b01010101];
|
||||
var stream = new ReadOnlyBitStream(new MemoryStream(data));
|
||||
uint? actual = stream.ReadBitsLE(bits);
|
||||
uint? actual = stream.ReadBitsBE(bits);
|
||||
|
||||
Assert.NotNull(actual);
|
||||
Assert.Equal(expected, actual);
|
||||
@@ -48,11 +48,11 @@ namespace SabreTools.IO.Test.Streams
|
||||
[Theory]
|
||||
[InlineData(4, 0b00001010, 1)]
|
||||
[InlineData(9, 0b10101010_1, 2)]
|
||||
public void ReadBitsBETest(int bits, uint expected, int position)
|
||||
public void ReadBitsLETest(int bits, uint expected, int position)
|
||||
{
|
||||
byte[] data = [0b01010101, 0b01010101, 0b01010101, 0b01010101];
|
||||
var stream = new ReadOnlyBitStream(new MemoryStream(data));
|
||||
uint? actual = stream.ReadBitsBE(bits);
|
||||
uint? actual = stream.ReadBitsLE(bits);
|
||||
|
||||
Assert.NotNull(actual);
|
||||
Assert.Equal(expected, actual);
|
||||
|
||||
@@ -88,11 +88,11 @@ namespace SabreTools.IO.Streams
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read a multiple bits in little-endian, if possible
|
||||
/// Read a multiple bits MSB-first, if possible
|
||||
/// </summary>
|
||||
/// <returns>The next bits encoded in a UInt32, null on error or end of stream</returns>
|
||||
/// <remarks>[76543210] order within a byte, appended to output [76543210]</remarks>
|
||||
public uint? ReadBitsLE(int bits)
|
||||
public uint? ReadBitsBE(int bits)
|
||||
{
|
||||
uint value = 0;
|
||||
for (int i = 0; i < bits; i++)
|
||||
@@ -110,11 +110,11 @@ namespace SabreTools.IO.Streams
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read a multiple bits in big-endian, if possible
|
||||
/// Read a multiple bits in LSB-first, if possible
|
||||
/// </summary>
|
||||
/// <returns>The next bits encoded in a UInt32, null on error or end of stream</returns>
|
||||
/// <remarks>[76543210] order within a byte, appended to output [01234567]</remarks>
|
||||
public uint? ReadBitsBE(int bits)
|
||||
public uint? ReadBitsLE(int bits)
|
||||
{
|
||||
uint value = 0;
|
||||
for (int i = 0; i < bits; i++)
|
||||
|
||||
Reference in New Issue
Block a user