public class ByteArrayStxEtxSerializer extends AbstractPooledBufferByteArraySerializer
Modifier and Type | Field and Description |
---|---|
static int |
ETX |
static ByteArrayStxEtxSerializer |
INSTANCE
A single reusable instance.
|
static int |
STX |
DEFAULT_MAX_MESSAGE_SIZE, logger
Constructor and Description |
---|
ByteArrayStxEtxSerializer() |
Modifier and Type | Method and Description |
---|---|
byte[] |
doDeserialize(InputStream inputStream,
byte[] buffer)
Reads the data in the inputStream to a byte[].
|
void |
serialize(byte[] bytes,
OutputStream outputStream)
Writes the byte[] to the stream, prefixed by an ASCII STX character and
terminated with an ASCII ETX character.
|
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 ByteArrayStxEtxSerializer INSTANCE
public static final int STX
public static final int ETX
public byte[] doDeserialize(InputStream inputStream, byte[] buffer) throws IOException
SoftEndOfStreamException
if the stream
is closed immediately before the STX (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 void serialize(byte[] bytes, OutputStream outputStream) throws IOException
IOException