public double ReadDouble(EndianStyle endianstyle) { byte[] buffer = base.ReadBytes(0x08); if (endianstyle == EndianStyle.BigEndian) { Array.Reverse(buffer); } return(BitConverter.ToDouble(buffer, 0)); }
public long ReadInt64(EndianStyle endianstyle) { byte[] buffer = base.ReadBytes(0x08); if (endianstyle == EndianStyle.BigEndian) { Array.Reverse(buffer); } return(BitConverter.ToInt64(buffer, 0)); }
public float ReadSingle(EndianStyle endianstyle) { byte[] Buffer = base.ReadBytes(0x04); if (endianstyle == EndianStyle.BigEndian) { Array.Reverse(Buffer); } return(BitConverter.ToSingle(Buffer, 0)); }
public EndianIO(string FilePath, EndianStyle EndianStyle, FileMode FileMode) { this._filePath = string.Empty; this._endianStyle = EndianStyle.LittleEndian; this._endianStyle = EndianStyle; this._filePath = FilePath; this._isFile = true; this.Open(FileMode); }
public EndianIO(string filepath, EndianStyle endianstyle) { this.filePath = string.Empty; this.endianStyle = EndianStyle.LittleEndian; this.endianStyle = endianstyle; this.filePath = filepath; this.isFile = true; this.Open(); }
public int ReadInt24(EndianStyle EndianStyle) { byte[] buffer = base.ReadBytes(3); if (EndianStyle == EndianStyle.BigEndian) { return(((buffer[0] << 0x10) | (buffer[1] << 8)) | buffer[2]); } return(((buffer[2] << 0x10) | (buffer[1] << 8)) | buffer[0]); }
public long ReadInt64(EndianStyle EndianStyle) { byte[] array = base.ReadBytes(8); if (EndianStyle == EndianStyle.BigEndian) { Array.Reverse(array); } return(BitConverter.ToInt64(array, 0)); }
public void Write(long value, EndianStyle EndianStyle) { byte[] bytes = BitConverter.GetBytes(value); if (EndianStyle == EndianStyle.BigEndian) { Array.Reverse(bytes); } base.Write(bytes); }
public ushort ReadUInt16(EndianStyle EndianStyle) { byte[] array = base.ReadBytes(2); if (EndianStyle == EndianStyle.BigEndian) { Array.Reverse(array); } return(BitConverter.ToUInt16(array, 0)); }
public EndianIO(byte[] Buffer, EndianStyle EndianStyle) { this._filePath = string.Empty; this._endianStyle = EndianStyle.LittleEndian; this._endianStyle = EndianStyle; this.Stream = new MemoryStream(Buffer); this._isFile = false; this.Open(); }
public uint ReadUInt32(EndianStyle endianstyle) { byte[] buffer = base.ReadBytes(0x04); if (endianstyle == EndianStyle.BigEndian) { Array.Reverse(buffer); } return(BitConverter.ToUInt32(buffer, 0)); }
public EndianIO(string filepath, EndianStyle endianstyle, FileMode filemode) { this.FilePath = string.Empty; this.EndianStyle = EndianStyle.LittleEndian; this.EndianStyle = endianstyle; this.FilePath = filepath; this.isFile = true; this.Open(filemode); }
public EndianIO(System.IO.Stream Stream, EndianStyle EndianStyle) { this._filePath = string.Empty; this._endianStyle = EndianStyle.LittleEndian; this._endianStyle = EndianStyle; this.Stream = Stream; this._isFile = false; this.Open(); }
public EndianIO(Stream stream, EndianStyle endianstyle) { this.FilePath = string.Empty; this.EndianStyle = EndianStyle.LittleEndian; this.EndianStyle = endianstyle; this.Stream = stream; this.isFile = false; this.Open(); }
public EndianIO(byte[] buffer, EndianStyle endianstyle) { this.FilePath = string.Empty; this.EndianStyle = EndianStyle.LittleEndian; this.EndianStyle = endianstyle; this.Stream = new MemoryStream(buffer); this.isFile = false; this.Open(); }
public int ReadInt32(EndianStyle EndianStyle) { byte[] array = base.ReadBytes(4); if (EndianStyle == EndianStyle.BigEndian) { Array.Reverse(array); } return(BitConverter.ToInt32(array, 0)); }
public bool ReadBoolean(EndianStyle EndianStyle) { byte[] array = base.ReadBytes(1); if (EndianStyle == EndianStyle.BigEndian) { Array.Reverse(array); } return(BitConverter.ToBoolean(array, 0)); }
public void Write(double value, EndianStyle endianstyle) { byte[] buffer = BitConverter.GetBytes(value); if (endianstyle == EndianStyle.BigEndian) { Array.Reverse(buffer); } base.Write(buffer); }
public float ReadSingle(EndianStyle EndianStyle) { byte[] array = base.ReadBytes(4); if (EndianStyle == EndianStyle.BigEndian) { Array.Reverse(array); } return(BitConverter.ToSingle(array, 0)); }
public double ReadDouble(EndianStyle EndianStyle) { byte[] array = base.ReadBytes(8); if (EndianStyle == EndianStyle.BigEndian) { Array.Reverse(array); } return(BitConverter.ToDouble(array, 0)); }
public void WriteInt24(int value, EndianStyle endianstyle) { byte[] Buffer = BitConverter.GetBytes(value); Array.Resize <byte>(ref Buffer, 3); if (endianstyle == EndianStyle.BigEndian) { Array.Reverse(Buffer); } base.Write(Buffer); }
public void WriteInt24(int value, EndianStyle EndianStyle) { byte[] bytes = BitConverter.GetBytes(value); Array.Resize <byte>(ref bytes, 3); if (EndianStyle == EndianStyle.BigEndian) { Array.Reverse(bytes); } base.Write(bytes); }
public int ReadInt32(EndianStyle endianstyle) { byte[] bytes = base.ReadBytes(4); if (endianstyle == EndianStyle.BigEndian) { Array.Reverse(bytes); } return(BitConverter.ToInt32(bytes, 0)); }
public ushort ReadUInt16(EndianStyle endianstyle) { byte[] bytes = base.ReadBytes(2); if (endianstyle == EndianStyle.BigEndian) { Array.Reverse(bytes); } return(BitConverter.ToUInt16(bytes, 0)); }
public ulong ReadUInt64(EndianStyle endianstyle) { byte[] bytes = base.ReadBytes(8); if (endianstyle == EndianStyle.BigEndian) { Array.Reverse(bytes); } return(BitConverter.ToUInt64(bytes, 0)); }
public void WriteUnicodeString(string String, int length, EndianStyle endianStyle) { int num = String.Length; for (int i = 0; i < num; i++) { if (i > length) { break; } ushort num3 = String[i]; this.Write(num3, endianStyle); } int num4 = (length - num) * 2; if (num4 > 0) { this.Write(new byte[num4]); } }
public string ReadUnicodeString(int length, EndianStyle endianStyle) { string str = string.Empty; int num = 0; for (int i = 0; i < length; i++) { ushort num3 = this.ReadUInt16(endianStyle); num++; if (num3 == 0) { break; } str = str + ((char)num3); } int num4 = (length - num) * 2; this.BaseStream.Seek((long)num4, SeekOrigin.Current); return(str); }
public void WriteUnicodeString(string str, int length, EndianStyle endianstyle) { int num = str.Length; for (int i = 0; i < num; i++) { if (i > length) { break; } ushort num2 = str[i]; this.Write(num2, endianstyle); } int num3 = (length - num) * 2; if (num3 > 0) { this.Write(new byte[num3]); } }
public EndianWriter(Stream Stream, EndianStyle EndianStyle) : base(Stream) { this._endianStyle = EndianStyle; }
public EndianWriter(Stream stream, EndianStyle endianstyle) : base(stream) { this.endianStyle = endianstyle; }