public WriteBytesAndSize ( byte buffer, int count ) : void | ||
buffer | byte | Array of bytes to write. |
count | int | Number of bytes from the array to write. |
return | void |
public void WriteBytesAndSize(byte[] buffer, int count)
{
if ((buffer == null) || (count == 0))
{
this.Write((ushort) 0);
}
else if (count > 0xffff)
{
if (LogFilter.logError)
{
Debug.LogError("NetworkWriter WriteBytesAndSize: buffer is too large (" + count + ") bytes. The maximum buffer size is 64K bytes.");
}
}
else
{
this.Write((ushort) count);
this.m_Buffer.WriteBytes(buffer, (ushort) count);
}
}
public override void Serialize(NetworkWriter writer) { writer.Write(this.netId); if (this.parameters == null) { writer.WriteBytesAndSize(this.parameters, 0); } else { writer.WriteBytesAndSize(this.parameters, this.parameters.Length); } }