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

pack-priv abstract Class AbstractIonWriter

extends Object
implements _Private_IonWriter, _Private_ByteTransferSink
Class Inheritance
All Implemented Interfaces
com.amazon.ion.impl._Private_ByteTransferSink, com.amazon.ion.impl._Private_IonWriter, com.amazon.ion.IonWriter, com.amazon.ion.facet.Faceted, java.io.Flushable, java.io.Closeable, java.lang.AutoCloseable
Known Direct Subclasses
com.amazon.ion.impl.bin.IonManagedBinaryWriter, com.amazon.ion.impl.bin.IonRawBinaryWriter
Imports
com.amazon.ion.Decimal, .IonDatagram, .IonReader, .IonType, .IonValue, .IonWriter, .SymbolToken, .Timestamp, com.amazon.ion.impl._Private_ByteTransferReader, ._Private_ByteTransferSink, ._Private_IonWriter, ._Private_SymtabExtendsCache, ._Private_Utils, java.io.IOException, java.math.BigInteger, java.util.Date

Common adapter for binary IonWriter implementations.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
private final _Private_SymtabExtendsCache
symtabExtendsCache

The cache for copy optimization checks--null if not copy optimized.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public <T> T
asFacet(Class<T>
The type token of the requested facet type.
facetType
)

Implements com.amazon.ion.facet.Faceted.asFacet.

Returns a facet of this subject if supported.

public final boolean
isStreamCopyOptimized()

Implements com.amazon.ion.impl._Private_IonWriter.isStreamCopyOptimized.

Indicates whether the writer is stream copy optimized through writeValue(com.amazon.ion.IonReader).

public abstract 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
)

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

public final void
writeTimestampUTC(final Date
java.util Date holding the UTC timestamp; may be null to represent null.timestamp.
value
)

Implements com.amazon.ion.IonWriter.writeTimestampUTC.

writes the passed in Date (in milliseconds since the epoch) as an IonTimestamp.

public final void
writeValue(final IonValue
may be null, in which case this method does nothing.
value
)

Implements com.amazon.ion.IonWriter.writeValue.

writes the contents of the passed in Ion value to the output.

public final void
writeValue(final IonReader reader)

Implements com.amazon.ion.IonWriter.writeValue.

Writes the current value from a reader.

public final void
writeValueRecursive(final IonReader
The IonReader that will provide a value to write.
reader
)

Performs a depth-first (recursive-like) traversal of the IonReader's current value, writing all values and annotations encountered during the traversal.

public final void
writeValues(final IonReader reader)

Implements com.amazon.ion.IonWriter.writeValues.

Writes a reader's current value, and all following values until the end of the current container.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

symtabExtendsCacheback to summary
private final _Private_SymtabExtendsCache symtabExtendsCache

The cache for copy optimization checks--null if not copy optimized.

Constructor Detail

AbstractIonWriterback to summary
pack-priv AbstractIonWriter(final AbstractIonWriter.WriteValueOptimization optimization)

Method Detail

asFacetback to summary
public <T> T asFacet(Class<T> facetType)

Implements com.amazon.ion.facet.Faceted.asFacet.

Doc from com.amazon.ion.facet.Faceted.asFacet.

Returns a facet of this subject if supported.

Parameters
<T>
The requested facet type.
facetType:Class<T>

The type token of the requested facet type.

Returns:T

An instance of T representing the facet of the subject, or null if the facet is not supported by the subject.

Annotations
@SuppressWarnings:deprecation
isStreamCopyOptimizedback to summary
public final boolean isStreamCopyOptimized()

Implements com.amazon.ion.impl._Private_IonWriter.isStreamCopyOptimized.

Doc from com.amazon.ion.impl._Private_IonWriter.isStreamCopyOptimized.

Indicates whether the writer is stream copy optimized through writeValue(com.amazon.ion.IonReader).

writeStringback to summary
public abstract void writeString(byte[] data, int offset, int length) throws IOException

Writes a portion of the byte array out as an IonString value. This copies the portion of the byte array that is written.

Parameters
data:byte[]

bytes to be written. May be null to represent null.string.

offset:int

offset of the first byte in value to write

length:int

number of bytes to write from value

See Also
IonWriter#writeClob(byte[], int, int), IonWriter#writeBlob(byte[], int, int)
writeTimestampUTCback to summary
public final void writeTimestampUTC(final Date value) throws IOException

Implements com.amazon.ion.IonWriter.writeTimestampUTC.

Doc from com.amazon.ion.IonWriter.writeTimestampUTC.

writes the passed in Date (in milliseconds since the epoch) as an IonTimestamp. The Date value is treated as a UTC value with an unknown timezone offset (a z value).

Parameters
value:Date

java.util Date holding the UTC timestamp; may be null to represent null.timestamp.

writeValueback to summary
public final void writeValue(final IonValue value) throws IOException

Implements com.amazon.ion.IonWriter.writeValue.

Doc from com.amazon.ion.IonWriter.writeValue.

writes the contents of the passed in Ion value to the output.

This method also writes annotations and field names (if in a struct), and performs a deep write, including the contents of any containers encountered.

Parameters
value:IonValue

may be null, in which case this method does nothing.

writeValueback to summary
public final void writeValue(final IonReader reader) throws IOException

Implements com.amazon.ion.IonWriter.writeValue.

Doc from com.amazon.ion.IonWriter.writeValue.

Writes the current value from a reader.

This method also writes annotations and field names (if in a struct), and performs a deep write, including the contents of any containers encountered.

writeValueRecursiveback to summary
public final void writeValueRecursive(final IonReader reader) throws IOException

Performs a depth-first (recursive-like) traversal of the IonReader's current value, writing all values and annotations encountered during the traversal. This method is not implemented using recursion.

Parameters
reader:IonReader

The IonReader that will provide a value to write.

Exceptions
IOException:
if either the provided IonReader or this writer's underlying OutputStream throw an IOException.
IllegalStateException:
if this writer is inside a struct but the IonReader is not.
writeValuesback to summary
public final void writeValues(final IonReader reader) throws IOException

Implements com.amazon.ion.IonWriter.writeValues.

Doc from com.amazon.ion.IonWriter.writeValues.

Writes a reader's current value, and all following values until the end of the current container. If there's no current value then this method calls IonReader#next() to get going.

This method iterates until IonReader#next() returns null and does not step out to the container of the current cursor position.

This method also writes annotations and field names (if in a struct), and performs a deep write, including the contents of any containers encountered.

com.amazon.ion.impl.bin back to summary

pack-priv final Enum AbstractIonWriter.WriteValueOptimization

extends Enum<AbstractIonWriter.WriteValueOptimization>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final AbstractIonWriter.WriteValueOptimization
public static final AbstractIonWriter.WriteValueOptimization

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static AbstractIonWriter.WriteValueOptimization
public static AbstractIonWriter.WriteValueOptimization[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

COPY_OPTIMIZEDback to summary
public static final AbstractIonWriter.WriteValueOptimization COPY_OPTIMIZED
NONEback to summary
public static final AbstractIonWriter.WriteValueOptimization NONE

Constructor Detail

WriteValueOptimizationback to summary
private WriteValueOptimization()

Method Detail

valueOfback to summary
public static AbstractIonWriter.WriteValueOptimization valueOf(String name)
valuesback to summary
public static AbstractIonWriter.WriteValueOptimization[] values()