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)
Delivers a message from a given sender to the application
|
void receive(A sender, byte[] buf, int offset, int length)
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 datavoid receive(A sender, java.nio.ByteBuffer buf)
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.
Note that buf could be a direct ByteBuffer.Copyright © 1998-2020 Red Hat. All Rights Reserved.