public ulong ReadULong() { ReadBytes(m_64b, 0, 8); return(BitConverter.ToUInt64(NetBuffer.ReverseOrder(m_64b), 0)); }
public ushort ReadUShort() { ReadBytes(m_16b, 0, 2); return(BitConverter.ToUInt16(NetBuffer.ReverseOrder(m_16b), 0)); }
public float ReadFloat() { ReadBytes(m_32b, 0, 4); return(BitConverter.ToSingle(NetBuffer.ReverseOrder(m_32b), 0)); }
public uint ReadUInt() { ReadBytes(m_32b, 0, 4); return(BitConverter.ToUInt32(NetBuffer.ReverseOrder(m_32b), 0)); }
public double ReadDouble() { ReadBytes(m_64b, 0, 8); return(BitConverter.ToDouble(NetBuffer.ReverseOrder(m_64b), 0)); }
public void WriteULong(ulong l, int writePos = -1) { byte[] bytes = BitConverter.GetBytes(l); this.WriteBytes(NetBuffer.ReverseOrder(bytes), writePos); }
public int WriteFloat(float value, int writePos = -1) { byte[] bytes = BitConverter.GetBytes(value); return(WriteBytes(NetBuffer.ReverseOrder(bytes), writePos)); }
/// <summary> /// copy the whole src to the object starting from dstOffset /// doesn't move the cursor, return the length /// </summary> public int CopyWith(NetBuffer src, int dstOffset = 0, bool bResetLen = false) { return(CopyWith(src, 0, dstOffset, bResetLen)); }
public int AddBuffer(NetBuffer src) { return(AddBytes(src.m_buff, 0, src.m_len)); }