public class Chunker
extends java.lang.Object
| Constructor and Description |
|---|
Chunker(long id,
java.nio.ByteBuffer buf,
int chunkSize)
Create a Chunker instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Whether there are more chunks available.
|
java.nio.ByteBuffer |
next()
Return the next chunk, or `null` if there are no chunks remaining.
|
public Chunker(long id,
java.nio.ByteBuffer buf,
int chunkSize)
id - An identifier for the message. Must be between 0 and 2**32-1.buf - The ByteBuffer containing the data that should be chunked.chunkSize - The chunk size *including* header data.java.lang.IllegalArgumentException - if message id is negativejava.lang.IllegalArgumentException - if chunk size is less than 1java.lang.IllegalArgumentException - if buffer is empty