IonReader implementation. Continuability is enabled
using IonReaderBuilder.withIncrementalReadingEnabled(true).
When continuable reading is enabled, if
IonReader#next() returns null at the top-level, it indicates that there is not (yet) enough data in
the stream to complete a top-level value. The user may wait for more data to become available in the stream and
call IonReader#next() again to continue reading. Unlike the non-incremental reader, the continuable reader
will never throw an exception due to unexpected EOF during next(). If, however, IonReader#close() is
called when an incomplete value is buffered, the reader will raise an IonException.
There is one caveat with the continuable reader implementation: it must be able to buffer an entire top-level value and any preceding system values (Ion version marker(s) and symbol table(s)) in memory. This means that each value and preceding system values must be no larger than any of the following:
IonBufferConfiguration.byte[], which is indexed by an int.| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private class | IonReaderContinuableTopLevelBinary.
References Deprecated
RawValueSpanProvider is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final boolean | |
| private final boolean | |
| private SymbolTable | |
| private IonType |
| Access | Constructor and Description |
|---|---|
| pack-priv | IonReaderContinuableTopLevelBinary(IonReaderBuilder
the builder containing the configuration for the new reader. builder, 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 new reader from the given input stream. |
| pack-priv | IonReaderContinuableTopLevelBinary(IonReaderBuilder
the builder containing the configuration for the new reader. builder, byte[] the byte array containing the bytes to read. data, 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 reader from the given byte array. |
| Modifier and Type | Method and Description |
|---|---|
| public <T> T | asFacet(Class<T>
The type token of the requested facet type. facetType)Implements com. Returns a facet of this subject if supported. |
| public void | close()
Overrides com. Implements java. Closes this stream and releases any system resources associated with it. |
| public IonType | getType()
Overrides com. Implements com. Returns the type of the current value, or null if there is no current value. |
| private void | handleIncompleteValue()
Handles the case where the current value extends beyond the end of the reader's internal buffer. |
| public boolean | hasNext()
Implements com. Determines whether there is another value at the current depth;
in other words whether there is a sibling value that may be reached
using |
| public IonType | next()
Implements com. Positions this reader on the next sibling after the current value, returning the type of that value. |
| private void | |
| public SymbolTable | |
| pack-priv void | prepareScalar()
Overrides com. Prepares a scalar value to be parsed by ensuring it is present in the buffer. |
| public void | stepIn()
Implements com. Positions the reader just before the contents of the current value, which must be a container (list, sexp, or struct). |
| public void | stepOut()
Implements com. Positions the iterator after the current parent's value, moving up one level in the data hierarchy. |
| isFillingValue | back to summary |
|---|---|
| private boolean isFillingValue | |
| isFillRequired | back to summary |
|---|---|
| private final boolean isFillRequired | |
| isNonContinuable | back to summary |
|---|---|
| private final boolean isNonContinuable | |
| symbolTableLastTransferred | back to summary |
|---|---|
| private SymbolTable symbolTableLastTransferred | |
| type | back to summary |
|---|---|
| private IonType type | |
| IonReaderContinuableTopLevelBinary | back to summary |
|---|---|
| pack-priv IonReaderContinuableTopLevelBinary(IonReaderBuilder builder, InputStream inputStream, byte[] alreadyRead, int alreadyReadOff, int alreadyReadLen) Constructs a new reader from the given input stream.
| |
| IonReaderContinuableTopLevelBinary | back to summary |
|---|---|
| pack-priv IonReaderContinuableTopLevelBinary(IonReaderBuilder builder, byte[] data, int offset, int length) Constructs a new reader from the given byte array.
| |
| asFacet | back to summary |
|---|---|
| public <T> T asFacet(Class<T> facetType) Implements com. Doc from com. Returns a facet of this subject if supported. | |
| close | back to summary |
|---|---|
| public void close() Overrides com. Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| getType | back to summary |
|---|---|
| public IonType getType() Overrides com. Implements com. Doc from com. Returns the type of the current value, or null if there is no current value.
| |
| handleIncompleteValue | back to summary |
|---|---|
| private void handleIncompleteValue() Handles the case where the current value extends beyond the end of the reader's internal buffer. | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements com. Doc from com. Determines whether there is another value at the current depth;
in other words whether there is a sibling value that may be reached
using Warning this method alters the internal state of the reader such
that you cannot reliably get values from the "current" element. The only
thing you should call after
| |
| next | back to summary |
|---|---|
| public IonType next() Implements com. Doc from com. Positions this reader on the next sibling after the current value,
returning the type of that value. Once so positioned the contents of
this value can be accessed with the
A sequence of
| |
| nextAndFill | back to summary |
|---|---|
| private void nextAndFill() Advances to the next value and attempts to fill it. | |
| pop_passed_symbol_table | back to summary |
|---|---|
| public SymbolTable pop_passed_symbol_table() Implements com.
| |
| prepareScalar | back to summary |
|---|---|
| pack-priv void prepareScalar() Overrides com. Prepares a scalar value to be parsed by ensuring it is present in the buffer.
| |
| stepIn | back to summary |
|---|---|
| public void stepIn() Implements com. Doc from com. Positions the reader just before the contents of the current value,
which must be a container (list, sexp, or struct).
There's no current value immediately after stepping in, so the next
thing you'll want to do is call
Stepping into a null container (
At any time
| |
| stepOut | back to summary |
|---|---|
| public void stepOut() Implements com. Doc from com. Positions the iterator after the current parent's value, moving up one
level in the data hierarchy.
There's no current value immediately after stepping out, so the next
thing you'll want to do is call
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final long | |
| pack-priv final long | |
| pack-priv final SymbolTable | |
| pack-priv final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | IonReaderBinarySpan(long
the offset of the span's first byte in the cursor's internal buffer. bufferOffset, long the offset after the span's last byte in the cursor's internal buffer. bufferLimit, long the total stream offset of the span's first byte. This can differ from 'bufferOffset' if
the cursor's internal buffer is refillable, such as when it consumes data from an input
stream. totalOffset, SymbolTable the symbol table active where the span occurs. symbolTable)
|
| Modifier and Type | Method and Description |
|---|---|
| public long | getFinishOffset()
Implements com. Returns this span's finish position as a zero-based offset within the source. |
| public long | getStartOffset()
Implements com. Returns this span's start position as a zero-based offset within the source. |
| bufferLimit | back to summary |
|---|---|
| pack-priv final long bufferLimit | |
| bufferOffset | back to summary |
|---|---|
| pack-priv final long bufferOffset | |
| symbolTable | back to summary |
|---|---|
| pack-priv final SymbolTable symbolTable | |
| totalOffset | back to summary |
|---|---|
| pack-priv final long totalOffset | |
| IonReaderBinarySpan | back to summary |
|---|---|
pack-priv IonReaderBinarySpan(long bufferOffset, long bufferLimit, long totalOffset, SymbolTable symbolTable)
| |
| getFinishOffset | back to summary |
|---|---|
| public long getFinishOffset() Implements com. Doc from com. Returns this span's finish position as a zero-based offset within the
source. In some cases, the finish position is implicit and this method
returns
| |
| getStartOffset | back to summary |
|---|---|
| public long getStartOffset() Implements com. Doc from com. Returns this span's start position as a zero-based offset within the source.
| |
References Deprecated
RawValueSpanProvider is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | |
| public Span | valueSpan()
Implements com. Constructs a Span, which may be faceted as an |
| RawValueSpanProviderFacet | back to summary |
|---|---|
| private RawValueSpanProviderFacet() | |
| buffer | back to summary |
|---|---|
| public byte[] buffer() Implements com.
| |
| valueSpan | back to summary |
|---|---|
| public Span valueSpan() Implements com. Doc from com. Constructs a Span, which may be faceted as an Note for Ion Warning Spans provided by this method are not compatible with the
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | hoist(Span span)
Implements com. Seeks this reader to produce the given span as if its values were at top-level. |
| SeekableReaderFacet | back to summary |
|---|---|
| private SeekableReaderFacet() | |
| hoist | back to summary |
|---|---|
| public void hoist(Span span) Implements com. Doc from com. Seeks this reader to produce the given span as if its values were at
top-level.
The caller cannot
After calling this method, this reader's current span will be empty and
positioned just before the first value of the given span; the caller
must call
Hoisting makes the span's values appear to be at top-level even if they
have containers in the source.
The depth will be zero, and
calls to
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Span | currentSpan()
Implements com. Gets the current span of this object, generally covering a single value on the source. |
| SpanProviderFacet | back to summary |
|---|---|
| private SpanProviderFacet() | |
| currentSpan | back to summary |
|---|---|
| public Span currentSpan() Implements com. Doc from com. Gets the current span of this object, generally covering a single value on the source.
| |