public ushort Read(ref ushort v) { if (this.buffer == null || this.position >= this.buffer.Length) { return(0); } v = BitConverter.ToUInt16(this.buffer, this.position); this.position += 2; v = ByteConverter.ReverseEndian(v); return(v); }
public int Read(ref int v) { if (this.buffer == null || this.position >= this.buffer.Length) { return(0); } v = BitConverter.ToInt32(this.buffer, this.position); this.position += 4; v = ByteConverter.ReverseEndian(v); return(v); }
public ulong Read(ref ulong v) { if (this.buffer == null || this.position >= this.buffer.Length) { return(0uL); } v = BitConverter.ToUInt64(this.buffer, this.position); this.position += 8; v = ByteConverter.ReverseEndian(v); return(v); }
public long Read(ref long v) { if ((this.buffer == null) || (this.position >= this.buffer.Length)) { return(0L); } v = BitConverter.ToInt64(this.buffer, this.position); this.position += 8; v = ByteConverter.ReverseEndian(v); return(v); }
public void Write(int i) { this.Reserve(4); this.writer.Write(ByteConverter.ReverseEndian(i)); }
public void Write(short s) { this.Reserve(2); this.writer.Write(ByteConverter.ReverseEndian(s)); }
public void Write(ulong l) { this.Reserve(8); this.writer.Write(ByteConverter.ReverseEndian(l)); }