Top Description Methods
com.amazon.ion

public Interface SeekableReader

extends SpanProvider
Known Direct Implementers
com.amazon.ion.impl.IonReaderContinuableTopLevelBinary.SeekableReaderFacet, com.amazon.ion.impl.IonReaderTextUserX.SeekableReaderFacet, com.amazon.ion.impl.IonReaderTreeUserX.SeekableReaderFacet

An IonReader facet providing the ability to retrieve Spans (abstract value positions) and seek to positions within the source.

Warning

This interface should not be implemented or extended by code outside of this library.

A span may be used to seek a different reader instance than the one that generated it, provided that the two readers have the same source. Violations of this constraint may not be detected reliably, so be careful or you'll get unsatisfying results.

Method Summary

Modifier and TypeMethod and Description
public void
hoist(Span span)

Seeks this reader to produce the given span as if its values were at top-level.

Inherited from com.amazon.ion.SpanProvider:
currentSpan

Method Detail

hoistback to summary
public void hoist(Span span)

Seeks this reader to produce the given span as if its values were at top-level. The caller cannot stepOut from the span nor continue reading beyond it.

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 next() to begin reading values. At the end of the span, the reader will behave as if it's at EOF regardless whether the source has more data beyond the span.

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 getFieldName() will return null even if the span's original parent was a struct.

Exceptions
IonException:
if the given span is unbalanced.