public class ByteArrayRawSerializer extends AbstractByteArraySerializer
Because the socket must be closed to indicate message end, this (de)serializer can only be used by uni-directional (non-collaborating) channel adapters, and not by gateways.
Prior to 4.2.2, when using NIO, a timeout caused whatever had been partially received to be emitted as a message.
Now, a SocketTimeoutException is thrown. To revert to the previous
behavior, set the treatTimeoutAsEndOfMessage constructor argument to true.
logger, maxMessageSize| Constructor and Description |
|---|
ByteArrayRawSerializer() |
ByteArrayRawSerializer(boolean treatTimeoutAsEndOfMessage)
Treat socket timeouts as a normal EOF and emit the (possibly partial)
message.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
deserialize(InputStream inputStream) |
void |
serialize(byte[] bytes,
OutputStream outputStream) |
checkClosure, copyToSizedArray, getMaxMessageSize, publishEvent, setApplicationEventPublisher, setMaxMessageSizepublic ByteArrayRawSerializer()
public ByteArrayRawSerializer(boolean treatTimeoutAsEndOfMessage)
treatTimeoutAsEndOfMessage - true to emit a message after a timeout.public void serialize(byte[] bytes,
OutputStream outputStream)
throws IOException
IOExceptionpublic byte[] deserialize(InputStream inputStream) throws IOException
IOException