public static void WriteByteArraySimple(this BasePacket stream, byte[] array, int maxLength) { if (stream.WriteBool(array != null)) { int length = Mathf.Min(array.Length, maxLength); if (length < array.Length) { NetLog.Warn("Only sending {0}/{1} bytes from byte array", length, array.Length); } stream.WriteUShort((ushort)length); stream.WriteByteArray(array, 0, length); } }