Class ByteArrayLengthHeaderSerializer

java.lang.Object
org.springframework.integration.ip.tcp.serializer.AbstractByteArraySerializer
org.springframework.integration.ip.tcp.serializer.ByteArrayLengthHeaderSerializer
All Implemented Interfaces:
Aware, ApplicationEventPublisherAware, Deserializer<byte[]>, Serializer<byte[]>

public class ByteArrayLengthHeaderSerializer
extends AbstractByteArraySerializer
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. For other header formats, override readHeader(InputStream) and writeHeader(OutputStream, int).
Since:
2.0
Author:
Gary Russell, Artem Bilan