Private Function ReadUShort(ByRef fs As FileStream) As UInt16 Dim buf(1) As Byte buf = ReadAndSwap(fs, buf.Length) Return BitConverter.ToUInt16(buf, 0) End Function Private Function ReadULong(ByRef fs As FileStream) As UInt32 Dim buf(3) As Byte buf = ReadAndSwap(fs, buf.Length) Return BitConverter.ToUInt32(buf, 0) End Function Private Function ReadAndSwap(ByRef fs As FileStream, ByVal size As Integer) As Byte() Dim buf(size - 1) As Byte fs.Read(buf, 0, buf.Length) Array.Reverse(buf) Return buf End Function