| Modifier and Type | Class and Description |
|---|---|
| private static enum | IonCursorBinary.
The kind of location at which `checkpoint` points. |
| private static class | IonCursorBinary.
State only used when the cursor's data source is refillable and the cursor is in slow mode. |
| private static enum | IonCursorBinary.
The state representing where the cursor left off after the previous operation. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Marker | annotationSequenceMarker
Marker for the sequence of annotation symbol IDs on the current value. |
| pack-priv byte[] | buffer
The buffer in which the cursor stores slices of the Ion stream. |
| pack-priv ByteBuffer | byteBuffer
A slice of the current buffer. |
| private long | checkpoint
The index of the first byte in the buffer that has not yet been successfully processed. |
| private IonCursorBinary. | checkpointLocation
Describes the byte at the `checkpoint` index. |
| private static final int | |
| pack-priv int | containerIndex
The index of the current container in `containerStack`. |
| pack-priv Marker[] | containerStack
Stack to hold container info. |
| private final BufferConfiguration. | dataHandler
The handler that will be notified when data is processed. |
| private static final int | |
| pack-priv IonCursor. | event
The event that occurred as a result of the last call to any of the cursor's IonCursor methods. |
| pack-priv int | fieldSid
The field SID of the current value, if any. |
| private static final IonBufferConfiguration[] | FIXED_SIZE_CONFIGURATIONS
Cache of configurations for fixed-sized streams. |
| pack-priv boolean | hasAnnotations
Indicates whether the current value is annotated. |
| private static final int | |
| pack-priv boolean | isSlowMode
Indicates whether the cursor is in slow mode. |
| pack-priv boolean | isValueIncomplete
Indicates whether the current value extends beyond the end of the buffer. |
| private static final int | |
| private static final int | |
| private static final int | |
| private IvmNotificationConsumer | ivmConsumer
The consumer to be notified when Ion version markers are encountered. |
| private long | lastReportedByteTotal
The total number of bytes that had been consumed from the stream as of the last time progress was reported to the data handler. |
| pack-priv long | limit
The index at which the next byte received will be written. |
| private static final int | |
| private static final int | |
| private int | majorVersion
The major version of the Ion encoding currently being read. |
| private static final int | |
| pack-priv int | minorVersion
The minor version of the Ion encoding currently being read. |
| private static final IvmNotificationConsumer | |
| private long | offset
The index of the next byte in the buffer that is available to be read. |
| pack-priv Marker | parent
The Marker representing the parent container of the current value. |
| private long | peekIndex
The index of the next byte to be read from the buffer. |
| private IonCursorBinary. | refillableState
Holds information necessary for reading from refillable input. |
| private static final int | |
| private final long | startOffset
The start offset into the user-provided byte array, or 0 if the user provided an InputStream. |
| private static final IonCursorBinary. | TERMINATED_STATE
Dummy state that indicates the cursor has been terminated and that additional API calls will have no effect. |
| private IonTypeID[] | typeIds
The set of type IDs to use for Ion version currently active in the stream. |
| private static final int | |
| pack-priv final Marker | valueMarker
Marker representing the current value. |
| pack-priv long | valuePreHeaderIndex
The index of the first byte in the header of the value at which the reader is currently positioned. |
| pack-priv IonTypeID | valueTid
Type ID for the current value. |
| Access | Constructor and Description |
|---|---|
| pack-priv | IonCursorBinary(final IonBufferConfiguration
the configuration to use. The buffer size and oversized value configuration are unused, as
the given buffer is used directly. configuration, byte[] the byte array containing the bytes to read. buffer, int the offset into the byte array at which the first byte of Ion data begins. offset, int the number of bytes to be read from the byte array. length)Constructs a new fixed (non-refillable) cursor from the given byte array. |
| pack-priv | IonCursorBinary(IonBufferConfiguration
the configuration to use. configuration, InputStream inputStream, byte[] the byte array containing the bytes already read (often the IVM). alreadyRead, int the offset into `alreadyRead` at which the first byte that was already read exists. alreadyReadOff, int the number of bytes already read from `alreadyRead`. alreadyReadLen)Constructs a refillable cursor from the given input stream. |
| Modifier and Type | Method and Description |
|---|---|
| private long | Returns: the number of bytes available in the buffer after the given index.a byte index in the buffer. index)
|
| private long | Returns: the end index of the value or NOP pad.the type ID of the value. valueTid, boolean true if the value is annotated. isAnnotated)Calculates the end index for the given type ID and sets `event` based on the type of value encountered, if any. |
| private long | |
| private boolean | Returns: true if the end of the current container has been reached; otherwise, false.Determines whether the cursor has reached the end of the current container. |
| public void | close()
Implements java. Closes this stream and releases any system resources associated with it. |
| public IonCursor. | endStream()
Implements com. Causes the cursor to force completion of the value on which it is currently positioned, if any. |
| private boolean | Returns: true if the buffer has sufficient capacity; otherwise, false.the minimum number of additional bytes to buffer. minimumNumberOfBytesRequired)Ensures that there is space for at least 'minimumNumberOfBytesRequired' additional bytes in the buffer, growing the buffer if necessary. |
| private boolean | Returns: false if not enough bytes were available in the stream to satisfy the request; otherwise, true.the index after which to fill. index, long the number of bytes after `index` that need to be present. numberOfBytes)Attempts to fill the buffer so that it contains at least `numberOfBytes` after `index`. |
| public IonCursor. | fillValue()
Implements com. Buffers the entirety of the value on which the cursor is currently positioned. |
| private long | |
| public IonCursor. | getCurrentEvent()
Implements com. Conveys the result of the previous operation. |
| private static BufferConfiguration. | Returns: the given configuration's DataHandler, or null if that DataHandler is a no-op.
|
| private static IonBufferConfiguration | Returns: a fixed IonBufferConfiguration.the stream. inputStream, int the number of bytes already read from the stream. The configuration provided will allow
enough space for these bytes. alreadyReadLen)Provides a fixed-size buffer configuration suitable for the given ByteArrayInputStream. |
| public int | |
| public int | |
| pack-priv long | |
| pack-priv Marker | |
| private void | |
| public boolean | |
| private boolean | Returns: true if the cursor is expecting more data in order to complete a token; otherwise, false.
|
| pack-priv boolean | |
| private static int | Returns: the exponent of the next power of two greater than or equal to the given number.a non-negative number. value)
|
| private void | moveBytesToStartOfBuffer(byte[]
the destination buffer, which may be 'buffer' itself or a new buffer. destinationBuffer, int fromIndex)Moves all buffered (but not yet read) bytes from 'buffer' to the destination buffer. |
| pack-priv static int | Returns: the next power of two greater than or equal to the given number.a non-negative number value)
|
| public IonCursor. | nextValue()
Implements com. Advances the cursor to the next value, skipping the current value (if any). |
| private void | prohibitEmptyOrderedStruct_1_0(Marker
the marker for the value to check. marker)Throws if the given marker represents an empty ordered struct, which is prohibited by the Ion 1.0 specification. |
| private void | |
| private int | Returns: the next byte, or -1 if the stream is at its end.Reads a single byte without adding it to the buffer. |
| private void | |
| private long | Returns: the shortfall between the number of bytes that were filled and the minimum number requested. If less than 1, then at least `minimumNumberOfBytesRequired` were filled.the minimum number of bytes requested to fill the current value. minimumNumberOfBytesRequired)Attempts to fill the buffer with up to the requested number of additional bytes. |
| public void | |
| pack-priv void | |
| private void | reportConsumedData()
Reports the total number of bytes consumed from the stream since the last report, up to the current `peekIndex`. |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | setCheckpoint(IonCursorBinary.
the type of checkpoint location. Must not be BEFORE_UNANNOTATED_TYPE_ID. locationSets `checkpoint` to the current `peekIndex`, which is at the given type of location. |
| private void | setCheckpointBeforeUnannotatedTypeId()
Sets `checkpoint` to the current `peekIndex`, which must be before an unannotated type ID, and seeks the buffer to that point. |
| private void | |
| private void | shiftContainerEnds(long
the amount to shift left. shiftAmount)Shift all active container end indices left by the given amount. |
| private void | shiftIndicesLeft(int
the amount to shift left. shiftAmount)Shift all indices left by the given amount. |
| pack-priv boolean | |
| pack-priv void | |
| private boolean | |
| private IonCursor. | Returns: `event`, which conveys the result.Fills the buffer with the contents of the value on which the cursor is currently positioned, ensuring that enough bytes are available in the stream. |
| private boolean | |
| private boolean | Returns: true if the cursor is expecting more data in order to complete a token; otherwise, false.
|
| private boolean | |
| private boolean | Returns: true if the cursor is ready; otherwise, false.Attempts to make the cursor READY by finishing the operation that was in progress last time the end of the stream was reached. |
| private void | slowNextToken()
Advances to the next token from the current checkpoint, seeking past the previous value if necessary, and ensuring that enough bytes are available in the stream. |
| private IonCursor. | Returns: the result of the operation (e.g. START_SCALAR, END_CONTAINER).Advances to the next value, seeking past the previous if necessary, and ensuring enough bytes are available in the stream. |
| private IonCursor. | Returns: the result of the operation (e.g. START_SCALAR, END_CONTAINER).Advances to the next token, ensuring enough bytes are available in the stream and checking against size limits. |
| private int | Returns: the byte, or -1 if the end of the stream has been reached.Peek at the next byte from the stream, assuming it will be buffered unless the current value is being skipped. |
| private boolean | Returns: true if there are not enough bytes in the stream to complete the value; otherwise, false.the type ID of the annotation wrapper. valueTid)Reads the header of an annotation wrapper, ensuring enough data is available in the buffer. |
| private boolean | |
| private int | Returns: the byte, or -1 if the end of the stream has been reached.Read the next byte from the stream, ensuring the byte is buffered. |
| private boolean | Returns: true if there are not enough bytes in the stream to complete the field SID; otherwise, false.Reads the field SID from the VarUInt starting at `peekIndex`, ensuring enough data is available in the buffer. |
| private boolean | |
| private boolean | Returns: false if enough bytes were buffered and the header belonged to an annotation wrapper or NOP pad; otherwise, true. When false, the caller should call the method again to read the header for the value that follows.the type ID byte. This may be an annotation wrapper's type ID. typeIdByte, final boolean true if this type ID is on a value within an annotation wrapper; false if it is not. isAnnotated, final Marker the Marker to set with information parsed from the type ID and/or annotation wrapper header. markerToSet)Reads a value or annotation wrapper header, ensuring enough bytes are buffered. |
| private boolean | Returns: true if not enough data was available in the stream to complete the header; otherwise, false.the type ID of the value. Must not be an annotation wrapper. valueTid, boolean true if this type ID is on a value within an annotation wrapper; false if it is not. isAnnotated, Marker the Marker to set with information parsed from the header. markerToSet)Reads a value header, ensuring enough bytes are buffered. |
| private long | Returns: the value.Reads a VarUInt, ensuring enough data is available in the buffer. |
| private long | |
| private boolean | Returns: true if not enough data was available in the stream; otherwise, false.the number of bytes to seek from `offset`. numberOfBytes)Seeks forward in the stream up to the requested number of bytes, from `offset`. |
| private boolean | Returns: true if not enough data was available to seek past the NOP pad; otherwise, false.the length of the NOP pad. valueLength, boolean true if the NOP pad occurs within an annotation wrapper (which is illegal); otherwise, false. isAnnotated)Validates and skips a NOP pad. |
| private boolean | |
| private boolean | |
| private boolean | Returns: true if not enough data was available in the stream; otherwise, false.Skips past the remaining bytes in the current value, ensuring enough bytes are available in the stream. |
| private IonCursor. | Returns: `event`, which conveys the result.Steps into the container on which the cursor is currently positioned, ensuring that the buffer is ready. |
| private IonCursor. | Returns: `event`, which conveys the result.Steps out of the container on which the cursor is currently positioned, ensuring that the buffer is ready and that enough bytes are available in the stream. |
| public IonCursor. | stepIntoContainer()
Implements com. Steps the cursor into the container value on which the cursor is currently positioned. |
| public IonCursor. | stepOutOfContainer()
Implements com. Steps the cursor out of the current container, skipping any values in the container that may follow. |
| pack-priv void | |
| private boolean | |
| private boolean | Returns: true if the end of the container has been reached; otherwise, false.Advances to the next value within a container, checking for container end and consuming the field name, if any. |
| private boolean | Returns: true if the next token was an Ion version marker or NOP pad; otherwise, false. If true, this method should be called again to advance to the following value.Advances to the next token, seeking past the previous value if necessary. |
| private boolean | Returns: true if the length of the wrapped value extends beyond the bytes currently buffered; otherwise, false.the type ID of the annotation wrapper. valueTid)Reads the header of an annotation wrapper. |
| private boolean | |
| private void | |
| private boolean | Returns: false if the header belonged to NOP pad; otherwise, true. When false, the caller should call the method again to read the header for the value that follows.the type ID byte. This may be an annotation wrapper's type ID. typeIdByte, final boolean true if this type ID is on a value within an annotation wrapper; false if it is not. isAnnotated, final Marker the Marker to set with information parsed from the type ID and/or annotation wrapper header. markerToSet)Reads a value header, consuming the value's annotation wrapper header, if any. |
| private long | Returns: the value.Reads a 2+ byte VarUInt, given the first byte. |
| private long | |
| private void | uncheckedSeekPastNopPad(long
the endIndex of the NOP pad. endIndex, boolean true if the NOP pad occurs within an annotation wrapper (which is illegal); otherwise, false. isAnnotated)Validates and skips a NOP pad. |
| private void | |
| private static void | validate(IonBufferConfiguration
the configuration to validate. configuration)Validates the given configuration. |
| private void | validateAnnotationWrapperEndIndex(long
the annotated value's endIndex. endIndex)Validates that an annotated value's endIndex matches the annotation wrapper's endIndex (which is contained in `valueMarker.endIndex`). |