@API(value=EXPERIMENTAL) public class ByteArrayContinuation extends Object implements RecordCursorContinuation
Modifier and Type | Method and Description |
---|---|
static RecordCursorContinuation |
fromInt(int a)
Return a
RecordCursorContinuation that wraps a byte array consisting of the given integer. |
static RecordCursorContinuation |
fromNullable(byte[] bytes)
Return a
RecordCursorContinuation from a byte array. |
boolean |
isEnd()
Return whether this continuation is an "end continuation", i.e., represents that the iteration has reached
its end and would not produce more results even if restarted.
|
byte[] |
toBytes()
Serialize this continuation to a byte array.
|
@Nonnull public byte[] toBytes()
RecordCursorContinuation
RecordCursorContinuation.isEnd()
returns true
, then toBytes()
must return
null
.toBytes
in interface RecordCursorContinuation
public boolean isEnd()
RecordCursorContinuation
isEnd()
returns true
, then
RecordCursorContinuation.toBytes()
must return null
.isEnd
in interface RecordCursorContinuation
@Nonnull public static RecordCursorContinuation fromNullable(@Nullable byte[] bytes)
RecordCursorContinuation
from a byte array. If the given byte array is non-null, return a
ByteArrayContinuation
wrapping that array. If the given byte array is null
, return a
RecordCursorEndContinuation
instead.bytes
- a nullable byte array representing a serialized continuationRecordCursorContinuation
as described above@Nonnull public static RecordCursorContinuation fromInt(int a)
RecordCursorContinuation
that wraps a byte array consisting of the given integer.a
- an integerByteArrayContinuation
wrapping a byte array of the given integer