Top Description Inners Fields Constructors Methods
com.amazon.ion.impl

pack-priv Class IonReaderContinuableApplicationBinary

extends IonReaderContinuableCoreBinary
implements IonReaderContinuableApplication
Class Inheritance
All Implemented Interfaces
com.amazon.ion.impl.IonReaderContinuableApplication, com.amazon.ion.impl.IonReaderContinuableCore, com.amazon.ion.IonCursor, java.io.Closeable, java.lang.AutoCloseable
Known Direct Subclasses
com.amazon.ion.impl.IonReaderContinuableTopLevelBinary
Imports
com.amazon.ion.IonCatalog, .IonException, .IonReader, .IonStruct, .IonType, .IonWriter, .ReadOnlyValueException, .SymbolTable, .SymbolToken, .SystemSymbols, .UnknownSymbolException, .ValueFactory, com.amazon.ion.impl.bin.IntList, com.amazon.ion.system.IonReaderBuilder, .SimpleCatalog, java.io.IOException, .InputStream, java.nio.charset.StandardCharsets, java.util.ArrayList, .Arrays, .HashMap, .Iterator, .List, .Map, .NoSuchElementException

An IonCursor capable of application-level parsing of binary Ion streams.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
IonReaderContinuableApplicationBinary.AnnotationSequenceIterator

Reusable iterator over the annotations on the current value.

private class
IonReaderContinuableApplicationBinary.LocalSymbolTableSnapshot

Read-only snapshot of the local symbol table at the reader's current position.

private static enum
private class
IonReaderContinuableApplicationBinary.SymbolTableReader

Uses the underlying raw reader to read the symbol tables from the stream.

Field Summary

Modifier and TypeField and Description
private final IonReaderContinuableApplicationBinary.AnnotationSequenceIterator
private SymbolTable
private final IonCatalog
private static final IonCatalog
private static final Iterator<String>
private int
private LocalSymbolTableImports
private static final LocalSymbolTableImports
private static final byte[]
private int
private IonReaderContinuableApplicationBinary.State
private String[]
private static final int
private final IonReaderContinuableApplicationBinary.SymbolTableReader
Inherited from com.amazon.ion.impl.IonReaderContinuableCoreBinary:
peekIndexutf8Decoder

Constructor Summary

AccessConstructor and Description
pack-priv
IonReaderContinuableApplicationBinary(IonReaderBuilder
the builder containing the configuration for the new reader.
builder
,
byte[]
the byte array containing the bytes to read.
bytes
,
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.

pack-priv
IonReaderContinuableApplicationBinary(final IonReaderBuilder
the builder containing the configuration for the new reader.
builder
,
final 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.

Method Summary

Modifier and TypeMethod and Description
private SymbolTable
createImport(String
the name of the shared symbol table.
name
,
int
the version of the shared symbol table.
version
,
int
the max_id of the shared symbol table. This value takes precedence over the actual max_id for the shared symbol table at the requested version.
maxId
)

Creates a shared symbol table import, resolving it from the catalog if possible.

public String
getFieldName()

Implements com.amazon.ion.impl.IonReaderContinuableApplication.getFieldName.

Return the field name of the current value.

public SymbolToken
getFieldNameSymbol()

Implements com.amazon.ion.impl.IonReaderContinuableApplication.getFieldNameSymbol.

Gets the current value's field name as a symbol token (text + ID).

pack-priv String

Returns:

a String.
getSymbol
(int
a symbol ID.
sid
)

Retrieves the String text for the given symbol ID.

private String

Returns:

a String, which will be null if the requested symbol ID has undefined text.
getSymbolString
(int
the symbol ID.
sid
,
LocalSymbolTableImports
the symbol table's shared symbol table imports.
importedSymbols
,
String[]
the symbol table's local symbols.
localSymbols
)

Gets the String representation of the given symbol ID. It is the caller's responsibility to ensure that the given symbol ID is within the max ID of the symbol table.

public SymbolTable
getSymbolTable()

Implements com.amazon.ion.impl.IonReaderContinuableApplication.getSymbolTable.

Returns the symbol table that is applicable to the current value.

private SymbolToken

Returns:

a SymbolToken.
getSymbolToken
(int
a symbol ID.
sid
)

Creates a SymbolToken representation of the given symbol ID.

private SymbolTable

Returns:

a system SymbolTable.
getSystemSymbolTable
()

Gets the system symbol table for the Ion version currently active.

public String[]
getTypeAnnotations()

Implements com.amazon.ion.impl.IonReaderContinuableApplication.getTypeAnnotations.

Return the annotations of the current value as an array of strings.

public SymbolToken[]
getTypeAnnotationSymbols()

Implements com.amazon.ion.impl.IonReaderContinuableApplication.getTypeAnnotationSymbols.

Gets the current value's annotations as symbol tokens (text + ID).

private void
growSymbolsArray(int shortfall)

private boolean

Returns:

true if the reader is positioned on a symbol table; otherwise, false.
isPositionedOnSymbolTable
()

public Iterator<String>
iterateTypeAnnotations()

Implements com.amazon.ion.impl.IonReaderContinuableApplication.iterateTypeAnnotations.

Return the annotations on the curent value as an iterator.

public IonCursor.Event
nextValue()

Overrides com.amazon.ion.impl.IonReaderContinuableCoreBinary.nextValue.

Implements com.amazon.ion.IonCursor.nextValue.

Advances the cursor to the next value, skipping the current value (if any).

private void
resetImports()

Reset the list of imported shared symbol tables.

private void
resetSymbolTable()

Reset the local symbol table to the system symbol table.

protected void
restoreSymbolTable(SymbolTable
the symbol table to restore.
symbolTable
)

Restore a symbol table from a previous point in the stream.

pack-priv boolean

Returns:

true if current value has a sequence of annotations that begins with `$ion_symbol_table`; otherwise, false.
startsWithIonSymbolTable
()

public String
public SymbolToken
symbolValue()

Implements com.amazon.ion.impl.IonReaderContinuableApplication.symbolValue.

Returns the current value as a symbol token (text + ID).

Inherited from com.amazon.ion.impl.IonReaderContinuableCoreBinary:
bigDecimalValuebigIntegerValuebooleanValuebyteSizeclosedateValuedecimalValuedoubleValuegetAnnotationIdsgetAnnotationSidListgetBytesgetDepthgetFieldIdgetIntegerSizegetTypeintValueisInStructisNullValuelongValuenewBytesprepareByteBufferprepareScalarreadVarUInt_1_0readVarUInt_1_1symbolValueIdtimestampValue