diff options
Diffstat (limited to 'DvdLib/BigEndianBinaryReader.cs')
| -rw-r--r-- | DvdLib/BigEndianBinaryReader.cs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/DvdLib/BigEndianBinaryReader.cs b/DvdLib/BigEndianBinaryReader.cs index b3b2eabd5..b3aad85ce 100644 --- a/DvdLib/BigEndianBinaryReader.cs +++ b/DvdLib/BigEndianBinaryReader.cs @@ -1,4 +1,6 @@ -using System; +#pragma warning disable CS1591 + +using System.Buffers.Binary; using System.IO; namespace DvdLib @@ -12,19 +14,12 @@ namespace DvdLib public override ushort ReadUInt16() { - return BitConverter.ToUInt16(ReadAndReverseBytes(2), 0); + return BinaryPrimitives.ReadUInt16BigEndian(base.ReadBytes(2)); } public override uint ReadUInt32() { - return BitConverter.ToUInt32(ReadAndReverseBytes(4), 0); - } - - private byte[] ReadAndReverseBytes(int count) - { - byte[] val = base.ReadBytes(count); - Array.Reverse(val, 0, count); - return val; + return BinaryPrimitives.ReadUInt32BigEndian(base.ReadBytes(4)); } } } |
