public static bool ParseHeader(byte[] packetHeader, ref ushort msgType, ref ushort msgLength) { bool result; if (packetHeader.Length < WfPacket.GetHeaderLength()) { result = false; } else { int offset = 0; msgLength = LBitConverter.ToUInt16(packetHeader, ref offset); msgType = LBitConverter.ToUInt16(packetHeader, ref offset); uint server_use = LBitConverter.ToUInt32(packetHeader, ref offset); result = true; } return(result); }
public void SetHeadLength() { int offset = 0; LBitConverter.GetBytes((ushort)GetOffset(), m_ReadBytes.GetBytes(), ref offset); }
public void Write(double i) { LBitConverter.GetBytes(i, s_WriteBytes, ref m_Offset); }
public void Write(String str) { LBitConverter.GetBytes(str, s_WriteBytes, ref m_Offset); }
public double ReadDouble() { return(LBitConverter.ToDouble(m_ReadBytes.GetBytes(), ref m_Offset)); }
public string ReadString(int strLength) { return(LBitConverter.ToString(m_ReadBytes.GetBytes(), ref m_Offset, strLength)); }
public float ReadFloat() { return(LBitConverter.ToSingle(m_ReadBytes.GetBytes(), ref m_Offset)); }
public bool ReadBool() { return(LBitConverter.ToBoolean(m_ReadBytes.GetBytes(), ref m_Offset)); }
public short ReadShort() { return(LBitConverter.ToInt16(m_ReadBytes.GetBytes(), ref m_Offset)); }
public long ReadInt64() { return(LBitConverter.ToInt64(m_ReadBytes.GetBytes(), ref m_Offset)); }
public int ReadInt() { return(LBitConverter.ToInt32(m_ReadBytes.GetBytes(), ref m_Offset)); }