Byte array length header (de)serializer
Serializes data preceded by a binary header indicating the data length
Reads data in an InputStream
to a byte[]
; data must be preceded by a binary length (network byte order, not included in resulting byte[]
).
Writes a byte[]
to an OutputStream
after a binary length.
The length field contains the length of data following the length field (network byte order). The default length field is a 4 byte signed integer. During deserialization, negative values will be rejected. Other options are an unsigned byte, and unsigned short.
Header size
Specifies the header size.
Valid header sizes are:
4
: Default length-header field, allows for data up to 2**31-1 bytes.2
: An unsigned short, for data up to 2**16 bytes.1
: A single unsigned byte, for data up to 255 bytes.
Default is 4
.
Id
Name that uniquely identifies this flow component.
Required
Max message size
The maximum supported message size (in bytes) for this (de)serializer.
Default is 2048 (2 KiB).
To avoid memory exhaustion due to a badly behaved client (one that does not adhere to the protocol of the configured serializer), this (de)serializer imposes a maximum message size. If the size is exceeded by an incoming message, an exception will be thrown. The default maximum message size is 2048 bytes, and can be increased by setting the maxMessageSize property.