public class MessageFramer extends Object
MessageFramer.Sink.| Modifier and Type | Class and Description |
|---|---|
static class |
MessageFramer.Compression |
static interface |
MessageFramer.Sink
Sink implemented by the transport layer to receive frames and forward them to their
destination.
|
| Constructor and Description |
|---|
MessageFramer(MessageFramer.Sink sink,
WritableBufferAllocator bufferAllocator)
Creates a
MessageFramer without compression. |
MessageFramer(MessageFramer.Sink sink,
WritableBufferAllocator bufferAllocator,
MessageFramer.Compression compression)
Creates a
MessageFramer. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Flushes and closes the framer and releases any buffers.
|
void |
dispose()
Closes the framer and releases any buffers, but does not flush.
|
void |
flush()
Flushes any buffered data in the framer to the sink.
|
boolean |
isClosed()
|
void |
writePayload(InputStream message,
int messageLength)
Writes out a payload message.
|
public MessageFramer(MessageFramer.Sink sink, WritableBufferAllocator bufferAllocator)
MessageFramer without compression.sink - the sink used to deliver frames to the transportbufferAllocator - allocates buffers that the transport can commit to the wire.public MessageFramer(MessageFramer.Sink sink, WritableBufferAllocator bufferAllocator, MessageFramer.Compression compression)
MessageFramer.sink - the sink used to deliver frames to the transportbufferAllocator - allocates buffers that the transport can commit to the wire.compression - the compression typepublic void writePayload(InputStream message, int messageLength)
message - contains the message to be written out. It will be completely consumed.messageLength - the number of bytes in the message. It must match the actual number of
bytes in the InputStream.public void flush()
public boolean isClosed()
public void close()
public void dispose()