Class ByteArrayContinuation

    • Method Detail

      • toBytes

        @Nonnull
        public byte[] toBytes()
        Description copied from interface: RecordCursorContinuation
        Serialize this continuation to a byte array. This method must always return the same array contents (but not necessarily the same array). If RecordCursorContinuation.isEnd() returns true, then toBytes() must return null.
        Specified by:
        toBytes in interface RecordCursorContinuation
        Returns:
        a (possibly null) byte array containing a binary serialization of this continuation
      • isEnd

        public boolean isEnd()
        Description copied from interface: RecordCursorContinuation
        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. If isEnd() returns true, then RecordCursorContinuation.toBytes() must return null.
        Specified by:
        isEnd in interface RecordCursorContinuation
        Returns:
        whether this continuation represents the end of a cursor's iteration
      • fromNullable

        @Nonnull
        public static RecordCursorContinuation fromNullable​(@Nullable
                                                            byte[] bytes)
        Return a 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.
        Parameters:
        bytes - a nullable byte array representing a serialized continuation
        Returns:
        a RecordCursorContinuation as described above
      • fromInt

        @Nonnull
        public static RecordCursorContinuation fromInt​(int a)
        Return a RecordCursorContinuation that wraps a byte array consisting of the given integer.
        Parameters:
        a - an integer
        Returns:
        a ByteArrayContinuation wrapping a byte array of the given integer