public class ByteArrayCrLfSerializer extends AbstractPooledBufferByteArraySerializer
Modifier and Type | Field and Description |
---|---|
static ByteArrayCrLfSerializer |
INSTANCE
A single reusable instance.
|
DEFAULT_MAX_MESSAGE_SIZE, logger
Constructor and Description |
---|
ByteArrayCrLfSerializer() |
Modifier and Type | Method and Description |
---|---|
byte[] |
doDeserialize(InputStream inputStream,
byte[] buffer)
Reads the data in the inputStream to a byte[].
|
int |
fillToCrLf(InputStream inputStream,
byte[] buffer) |
void |
serialize(byte[] bytes,
OutputStream outputStream)
Writes the byte[] to the stream and appends \r\n.
|
copyToSizedArray, deserialize, setPoolSize, setPoolWaitTimeout
checkClosure, getMaxMessageSize, publishEvent, setApplicationEventPublisher, setMaxMessageSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
serializeToByteArray
deserializeFromByteArray
public static final ByteArrayCrLfSerializer INSTANCE
public byte[] doDeserialize(InputStream inputStream, byte[] buffer) throws IOException
SoftEndOfStreamException
if the stream
is closed immediately after the \r\n (i.e. no data is in the process of
being read).doDeserialize
in class AbstractPooledBufferByteArraySerializer
inputStream
- the input stream.buffer
- the raw working buffer (maxMessageSize).IOException
- an io exception.public int fillToCrLf(InputStream inputStream, byte[] buffer) throws IOException
IOException
public void serialize(byte[] bytes, OutputStream outputStream) throws IOException
IOException