public abstract class AbstractPooledBufferByteArraySerializer extends AbstractByteArraySerializer
DEFAULT_MAX_MESSAGE_SIZE, logger
Constructor and Description |
---|
AbstractPooledBufferByteArraySerializer() |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
copyToSizedArray(byte[] buffer,
int size)
Copy size bytes to a new buffer exactly size bytes long.
|
byte[] |
deserialize(InputStream inputStream) |
protected abstract byte[] |
doDeserialize(InputStream inputStream,
byte[] buffer) |
void |
setPoolSize(int size)
Set the pool size for deserialization buffers.
|
void |
setPoolWaitTimeout(long poolWaitTimeout)
Set the pool wait timeout if a pool is configured, default unlimited.
|
checkClosure, getMaxMessageSize, publishEvent, setApplicationEventPublisher, setMaxMessageSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
serialize, serializeToByteArray
deserializeFromByteArray
public AbstractPooledBufferByteArraySerializer()
public void setPoolSize(int size)
size
- the size, -1 for unlimited.public void setPoolWaitTimeout(long poolWaitTimeout)
poolWaitTimeout
- the timeout.public final byte[] deserialize(InputStream inputStream) throws IOException
IOException
protected abstract byte[] doDeserialize(InputStream inputStream, byte[] buffer) throws IOException
inputStream
- the input stream.buffer
- the raw working buffer (maxMessageSize).IOException
- an io exception.protected byte[] copyToSizedArray(byte[] buffer, int size)
buffer
- The buffer containing the data.size
- The number of bytes to copy.