public override void Write(long value) { if (!IsLittleEndian) { value = ByteSwap.SwapBytes(value); } base.Write(value); }
public override unsafe void Write(float value) { if (!IsLittleEndian) { value = *(float *)ByteSwap.SwapBytes(*(uint *)&value); } base.Write(value); }
public override unsafe void Write(double value) { // BitConverter.DoubleToInt64Bits: // return *((long*)&value); // if (!IsLittleEndian) { value = BitConverter.Int64BitsToDouble(ByteSwap.SwapBytes(BitConverter.DoubleToInt64Bits(value))); } base.Write(value); }
public override ulong ReadUInt64() { var value = base.ReadUInt64(); return(IsLittleEndian ? value : ByteSwap.SwapBytes(value)); }
public override int ReadInt32() { var value = base.ReadInt32(); return(IsLittleEndian ? value : ByteSwap.SwapBytes(value)); }
public override ushort ReadUInt16() { var value = base.ReadUInt16(); return(IsLittleEndian ? value : ByteSwap.SwapBytes(value)); }