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

pack-priv final Class IonManagedBinaryWriter

extends AbstractIonWriter
implements _Private_IonManagedWriter
Class Inheritance
All Implemented Interfaces
com.amazon.ion.impl.bin._Private_IonManagedWriter, com.amazon.ion.IonWriter, com.amazon.ion.facet.Faceted, java.io.Flushable, java.io.Closeable, java.lang.AutoCloseable
Annotations
@SuppressWarnings:deprecation
Static Imports
com.amazon.ion.IonType.LIST, .IonType.STRUCT, .SystemSymbols.IMPORTS_SID, .SystemSymbols.ION_1_0_MAX_ID, .SystemSymbols.ION_SYMBOL_TABLE_SID, .SystemSymbols.MAX_ID_SID, .SystemSymbols.NAME_SID, .SystemSymbols.SYMBOLS_SID, .SystemSymbols.VERSION_SID, com.amazon.ion.impl.bin.Symbols.symbol, .Symbols.systemSymbol, .Symbols.systemSymbolTable, .Symbols.systemSymbols, java.util.Collections.unmodifiableList

References Deprecated

_Private_IonManagedWriter is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Wraps IonRawBinaryWriter with symbol table management.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
pack-priv static class
IonManagedBinaryWriter.ImportedSymbolContext

Provides the import context for the writer.

pack-priv static enum
IonManagedBinaryWriter.ImportedSymbolResolverMode

Determines how imported symbols are resolved (including system symbols).

private static class
private class
IonManagedBinaryWriter.LocalSymbolTableView

View over the internal local symbol table state as a symbol table.

private static interface
private static interface
private static enum
private static enum

Field Summary

Modifier and TypeField and Description
private final IonManagedBinaryWriter.ImportedSymbolContext
private final IonCatalog
private boolean
private static final SymbolTable[]
private IonManagedBinaryWriter.ImportedSymbolContext
private boolean
private final Map<String, SymbolToken>
private boolean
private SymbolTable
private final boolean
pack-priv static final IonManagedBinaryWriter.ImportedSymbolContext
private final IonRawBinaryWriter
symbols

References Deprecated IonRawBinaryWriter is deprecated or references (maybe indirectly) at least one deprecated element.
private IonManagedBinaryWriter.SymbolState
private final IonRawBinaryWriter
user

References Deprecated IonRawBinaryWriter is deprecated or references (maybe indirectly) at least one deprecated element.
private final IonManagedBinaryWriter.ImportDescriptor
private final List<SymbolTable>
private IonManagedBinaryWriter.UserState
private final List<String>
private long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
addTypeAnnotation(final String
string annotation to append to the annotation list
annotation
)

Implements com.amazon.ion.IonWriter.addTypeAnnotation.

Adds a given string to the list of pending annotations.

public void
close()

Implements com.amazon.ion.IonWriter.close.

Closes this stream and releases any system resources associated with it.

public void
finish()

Implements com.amazon.ion.IonWriter.finish.

Indicates that writing is completed and all buffered data should be written and flushed as if this were the end of the Ion data stream.

public void
flush()

Implements com.amazon.ion.IonWriter.flush.

Flushes this writer by writing any buffered output to the underlying output target without finalizing the stream's local symbol table.

public IonCatalog
getCatalog()

Implements com.amazon.ion.impl._Private_IonWriter.getCatalog.

Mostly for testing at this point, but could be useful public API.

public int
getDepth()

Implements com.amazon.ion.impl._Private_IonWriter.getDepth.

Returns the current depth of containers the writer is at.

public _Private_IonRawWriter
getRawWriter()

Implements com.amazon.ion.impl.bin._Private_IonManagedWriter.getRawWriter.

References Deprecated _Private_IonRawWriter is deprecated or references (maybe indirectly) at least one deprecated element.

Get the underlying raw user value writer.

public SymbolTable
getSymbolTable()

Implements com.amazon.ion.IonWriter.getSymbolTable.

Gets the symbol table that is currently in use by the writer.

private boolean
handleIVM(int sid)

private SymbolToken
intern(final String text)

private SymbolToken
intern(final SymbolToken token)

public boolean
isFieldNameSet()

Implements com.amazon.ion.impl._Private_IonWriter.isFieldNameSet.

Returns true if the field name has been set either through setFieldName or setFieldId.

public boolean
isInStruct()

Implements com.amazon.ion.IonWriter.isInStruct.

Determines whether values are being written as fields of a struct.

public void
requireLocalSymbolTable()

Implements com.amazon.ion.impl.bin._Private_IonManagedWriter.requireLocalSymbolTable.

If a local symbol table has not already been started by this writer since it was constructed or last finished, start writing a local symbol table by opening the struct and declaring the imports.

public void
setFieldName(final String
text of the field name
name
)

Implements com.amazon.ion.IonWriter.setFieldName.

Sets the pending field name to the given text.

public void
setFieldNameSymbol(SymbolToken
text of the field name
token
)

Implements com.amazon.ion.IonWriter.setFieldNameSymbol.

Sets the pending field name to the given token.

public void
setTypeAnnotations(final String...
string array with the annotations. If null or empty, any pending annotations are cleared.
annotations
)

Implements com.amazon.ion.IonWriter.setTypeAnnotations.

Sets the full list of pending annotations to the given text symbols.

public void
setTypeAnnotationSymbols(final SymbolToken...
If null or empty, any pending annotations are cleared.
annotations
)

Implements com.amazon.ion.IonWriter.setTypeAnnotationSymbols.

Sets the full list of pending annotations to the given symbols.

private void
startLocalSymbolTableIfNeeded(final boolean writeIVM)

private void
public void
stepIn(final IonType containerType)

Implements com.amazon.ion.IonWriter.stepIn.

Writes the beginning of a non-null container (list, sexp, or struct).

public void
stepOut()

Implements com.amazon.ion.IonWriter.stepOut.

Writes the end of the current container, returning this writer to the context of parent container.

private void
public void
writeBlob(byte[]
may be null to represent null.blob.
data
)

Implements com.amazon.ion.IonWriter.writeBlob.

write the byte array out as an IonBlob value.

public void
writeBlob(final byte[]
bytes to be written. May be null to represent null.blob.
data
,
final int
offset of the first byte in value to write
offset
,
final int
number of bytes to write from value
length
)

Implements com.amazon.ion.IonWriter.writeBlob.

Writes a portion of the byte array out as an IonBlob value.

public void
writeBool(final boolean
true or false as desired
value
)

Implements com.amazon.ion.IonWriter.writeBool.

writes a non-null boolean value (true or false) as an IonBool to output.

public void
writeBytes(byte[]
The byte array to write.
data
,
int
The offset in the array to write from.
off
,
int
The length of data to write.
len
)

Implements com.amazon.ion.impl._Private_ByteTransferSink.writeBytes.

Writes the given data to the sink.

public void
writeClob(byte[]
may be null to represent null.clob.
data
)

Implements com.amazon.ion.IonWriter.writeClob.

write the byte array out as an IonClob value.

public void
writeClob(final byte[]
bytes to be written. May be null to represent null.clob.
data
,
final int
offset of the first byte in value to write
offset
,
final int
number of bytes to write from value
length
)

Implements com.amazon.ion.IonWriter.writeClob.

Writes a portion of the byte array out as an IonClob value.

public void
writeDecimal(final BigDecimal
may be null to represent null.decimal.
value
)

Implements com.amazon.ion.IonWriter.writeDecimal.

Writes a BigDecimal value as an Ion decimal.

public void
writeFloat(final double
double to write
value
)

Implements com.amazon.ion.IonWriter.writeFloat.

writes a 64 bit binary floating point value, a Java double, as an IonFloat.

public void
writeInt(long
signed int to write
value
)

Implements com.amazon.ion.IonWriter.writeInt.

writes a signed 64 bit value, a Java long, as an IonInt.

public void
writeInt(final BigInteger
BigInteger to write
value
)

Implements com.amazon.ion.IonWriter.writeInt.

writes a BigInteger value as an IonInt.

public void
writeIonVersionMarker()

Implements com.amazon.ion.impl._Private_IonWriter.writeIonVersionMarker.

Write an Ion version marker symbol to the output.

public void
writeNull()

Implements com.amazon.ion.IonWriter.writeNull.

Writes a value of Ion's null type (null aka null.null).

public void
writeNull(final IonType
type of the null to be written
type
)

Implements com.amazon.ion.IonWriter.writeNull.

Writes a null value of a specified Ion type.

public void
writeString(final String
may be null to represent null.string.
value
)

Implements com.amazon.ion.IonWriter.writeString.

Writes a java.lang.String as an Ion string.

public void
writeString(byte[]
bytes to be written. May be null to represent null.string.
data
,
int
offset of the first byte in value to write
offset
,
int
number of bytes to write from value
length
)

Implements abstract com.amazon.ion.impl.bin.AbstractIonWriter.writeString.

Writes a portion of the byte array out as an IonString value.

public void
writeSymbol(String
may be null to represent null.symbol.
content
)

Implements com.amazon.ion.IonWriter.writeSymbol.

Writes the text of an Ion symbol value.

public void
writeSymbolToken(SymbolToken
may be null to represent null.symbol.
token
)

Implements com.amazon.ion.IonWriter.writeSymbolToken.

Writes the content of an Ion symbol value.

public void
writeTimestamp(final Timestamp
may be null to represent null.timestamp.
value
)

Implements com.amazon.ion.IonWriter.writeTimestamp.

Writes a timestamp value.

Inherited from com.amazon.ion.impl.bin.AbstractIonWriter:
asFacetisStreamCopyOptimizedwriteTimestampUTCwriteValuewriteValuewriteValueRecursivewriteValues