public ReadBytes ( int numberOfBytes, byte &result ) : bool | ||
numberOfBytes | int | |
result | byte | |
return | bool |
public bool ReadBytes(int numberOfBytes, out byte[] result)
{
if (m_bitLength - m_readPosition + 7 < (numberOfBytes * 8))
{
result = null;
return false;
}
result = new byte[numberOfBytes];
NetBitWriter.ReadBytes(m_data, numberOfBytes, m_readPosition, result, 0);
m_readPosition += (8 * numberOfBytes);
return true;
}
public void Read(NetBuffer im) { MessagePacketId = im.ReadInt64(); Number = im.ReadInt32(); int length = im.ReadInt32(); if (length != 0) { Bytes = im.ReadBytes(length); } }