From a7b50dfdf27cfeff634d8cb584a10b95e2dbbb3d Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 25 Nov 2024 23:12:05 -0500 Subject: [PATCH] Fix bitstream read naming again --- SabreTools.IO.Test/Streams/ReadOnlyBitStreamTests.cs | 8 ++++---- SabreTools.IO/Streams/ReadOnlyBitStream.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/SabreTools.IO.Test/Streams/ReadOnlyBitStreamTests.cs b/SabreTools.IO.Test/Streams/ReadOnlyBitStreamTests.cs index 5421951..8086d89 100644 --- a/SabreTools.IO.Test/Streams/ReadOnlyBitStreamTests.cs +++ b/SabreTools.IO.Test/Streams/ReadOnlyBitStreamTests.cs @@ -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); diff --git a/SabreTools.IO/Streams/ReadOnlyBitStream.cs b/SabreTools.IO/Streams/ReadOnlyBitStream.cs index 8304e7b..ef8ed06 100644 --- a/SabreTools.IO/Streams/ReadOnlyBitStream.cs +++ b/SabreTools.IO/Streams/ReadOnlyBitStream.cs @@ -88,11 +88,11 @@ namespace SabreTools.IO.Streams } /// - /// Read a multiple bits in little-endian, if possible + /// Read a multiple bits MSB-first, if possible /// /// The next bits encoded in a UInt32, null on error or end of stream /// [76543210] order within a byte, appended to output [76543210] - 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 } /// - /// Read a multiple bits in big-endian, if possible + /// Read a multiple bits in LSB-first, if possible /// /// The next bits encoded in a UInt32, null on error or end of stream /// [76543210] order within a byte, appended to output [01234567] - public uint? ReadBitsBE(int bits) + public uint? ReadBitsLE(int bits) { uint value = 0; for (int i = 0; i < bits; i++)