Beispiel #1
0
 public ulong ReadULong()
 {
     ReadBytes(m_64b, 0, 8);
     return(BitConverter.ToUInt64(NetBuffer.ReverseOrder(m_64b), 0));
 }
Beispiel #2
0
 public ushort ReadUShort()
 {
     ReadBytes(m_16b, 0, 2);
     return(BitConverter.ToUInt16(NetBuffer.ReverseOrder(m_16b), 0));
 }
Beispiel #3
0
 public float ReadFloat()
 {
     ReadBytes(m_32b, 0, 4);
     return(BitConverter.ToSingle(NetBuffer.ReverseOrder(m_32b), 0));
 }
Beispiel #4
0
 public uint ReadUInt()
 {
     ReadBytes(m_32b, 0, 4);
     return(BitConverter.ToUInt32(NetBuffer.ReverseOrder(m_32b), 0));
 }
Beispiel #5
0
 public double ReadDouble()
 {
     ReadBytes(m_64b, 0, 8);
     return(BitConverter.ToDouble(NetBuffer.ReverseOrder(m_64b), 0));
 }
Beispiel #6
0
 public void WriteULong(ulong l, int writePos = -1)
 {
     byte[] bytes = BitConverter.GetBytes(l);
     this.WriteBytes(NetBuffer.ReverseOrder(bytes), writePos);
 }
Beispiel #7
0
 public int WriteFloat(float value, int writePos = -1)
 {
     byte[] bytes = BitConverter.GetBytes(value);
     return(WriteBytes(NetBuffer.ReverseOrder(bytes), writePos));
 }
Beispiel #8
0
 /// <summary>
 /// 把src对象的数组copy到本对象,从dstOffect的地方开始
 /// 不移动游标,返回长度
 /// </summary>
 public int CopyWith(NetBuffer src, int dstOffset = 0, bool bResetLen = false)
 {
     return(CopyWith(src, 0, dstOffset, bResetLen));
 }
Beispiel #9
0
 public int AddBuffer(NetBuffer src)
 {
     return(AddBytes(src.m_buff, 0, src.m_len));
 }