public void Write(UInt16 source, int numberOfBits) { EnsureBufferSize(m_bitLength + numberOfBits); NetBitWriter.WriteUInt16(source, numberOfBits, m_data, m_bitLength); m_bitLength += numberOfBits; }
/// <summary> /// Writes a signed 16 bit integer /// </summary> public void Write(Int16 source) { EnsureBufferSize(m_bitLength + 16); NetBitWriter.WriteUInt16((ushort)source, 16, m_data, m_bitLength); m_bitLength += 16; }
/// <summary> /// write the size of the message to the beginning 2 bytes. Maximum of 65535 length supported. /// </summary> internal void WriteSize() { var size = LengthBytes - 2; NetBitWriter.WriteUInt16(checked ((ushort)size), 16, Data, 0); }