Top Description Fields Constructors Methods
org.glassfish.tyrus.core

pack-priv Class BinaryBuffer

extends Object
Class Inheritance
Imports
java.nio.Buffer, .ByteBuffer, java.util.ArrayList, .List, java.util.logging.Level, .Logger, org.glassfish.tyrus.core.l10n.LocalizationMessages

Save received partial messages to a list and concatenate them.
Authors
Stepan Kopriva, Pavel Bucek

Field Summary

Modifier and TypeField and Description
private int
private int
private final List<ByteBuffer>
private static final Logger

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
appendMessagePart(ByteBuffer
to be buffered.
message
)

Append buffer.

pack-priv ByteBuffer

Returns:

concatenated buffer.
getBufferedContent
()

Return concatenated list of buffers and reset internal state.

pack-priv void
resetBuffer(int
max buffer size.
bufferSize
)

Reset buffer with setting maximal buffer size.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferSizeback to summary
private int bufferSize
currentlyBufferedback to summary
private int currentlyBuffered
listback to summary
private final List<ByteBuffer> list
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

BinaryBufferback to summary
pack-priv BinaryBuffer()

Method Detail

appendMessagePartback to summary
pack-priv void appendMessagePart(ByteBuffer message)

Append buffer.

Actual implementation just stores the buffer instance in list.

Parameters
message:ByteBuffer

to be buffered.

getBufferedContentback to summary
pack-priv ByteBuffer getBufferedContent()

Return concatenated list of buffers and reset internal state.

Returns:ByteBuffer

concatenated buffer.

resetBufferback to summary
pack-priv void resetBuffer(int bufferSize)

Reset buffer with setting maximal buffer size.

Parameters
bufferSize:int

max buffer size.