Constructor and Description |
---|
ReceiverAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
receive(A sender,
byte[] buf,
int offset,
int length)
Delivers a message from a given sender to the application
|
void |
receive(A sender,
java.nio.ByteBuffer buf)
The default implementation assumes that
Buffer.flip() or Buffer.rewind() was called on
buf before invoking this callback |
public void receive(A sender, byte[] buf, int offset, int length)
Receiver
receive
in interface Receiver<A>
sender
- The sender of the messagebuf
- The buffer. Invokers of receive() must ensure that the contents of buf are not overwritten, e.g. by
copying it if a buffer is reused. The application can therefore hang on to buf as long as it needs to.
When buf is not referenced any longer, it can get garbage collected.offset
- The offset at which the received data startslength
- The length of the received dataCopyright © 1998-2020 Red Hat. All Rights Reserved.