Example #1
0
 public ulong ReadULong()
 {
     ReadBytes(m_64b, 0, 8);
     return(BitConverter.ToUInt64(NetBuffer.ReverseOrder(m_64b), 0));
 }
Example #2
0
 public ushort ReadUShort()
 {
     ReadBytes(m_16b, 0, 2);
     return(BitConverter.ToUInt16(NetBuffer.ReverseOrder(m_16b), 0));
 }
Example #3
0
 public float ReadFloat()
 {
     ReadBytes(m_32b, 0, 4);
     return(BitConverter.ToSingle(NetBuffer.ReverseOrder(m_32b), 0));
 }
Example #4
0
 public uint ReadUInt()
 {
     ReadBytes(m_32b, 0, 4);
     return(BitConverter.ToUInt32(NetBuffer.ReverseOrder(m_32b), 0));
 }
Example #5
0
 public double ReadDouble()
 {
     ReadBytes(m_64b, 0, 8);
     return(BitConverter.ToDouble(NetBuffer.ReverseOrder(m_64b), 0));
 }
Example #6
0
 public void WriteULong(ulong l, int writePos = -1)
 {
     byte[] bytes = BitConverter.GetBytes(l);
     this.WriteBytes(NetBuffer.ReverseOrder(bytes), writePos);
 }
Example #7
0
 public int WriteFloat(float value, int writePos = -1)
 {
     byte[] bytes = BitConverter.GetBytes(value);
     return(WriteBytes(NetBuffer.ReverseOrder(bytes), writePos));
 }
Example #8
0
 /// <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));
 }
Example #9
0
 public int AddBuffer(NetBuffer src)
 {
     return(AddBytes(src.m_buff, 0, src.m_len));
 }