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

pack-priv final Class IonRawBinaryWriter

extends AbstractIonWriter
implements _Private_IonRawWriter
Class Inheritance
All Implemented Interfaces
com.amazon.ion.impl.bin._Private_IonRawWriter, 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.Decimal.isNegativeZero, .IonType.BLOB, .IonType.BOOL, .IonType.CLOB, .IonType.DECIMAL, .IonType.FLOAT, .IonType.INT, .IonType.LIST, .IonType.NULL, .IonType.SEXP, .IonType.STRING, .IonType.STRUCT, .IonType.SYMBOL, .IonType.TIMESTAMP, .IonType.isContainer, .SystemSymbols.ION_1_0_SID, .SystemSymbols.ION_SYMBOL_TABLE_SID, .Timestamp.Precision.DAY, .Timestamp.Precision.MINUTE, .Timestamp.Precision.MONTH, .Timestamp.Precision.SECOND, java.lang.Double.doubleToRawLongBits, .Float.floatToRawIntBits

References Deprecated

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

See corresponding docs for further information.

Low-level binary IonWriter that understands encoding concerns but doesn't operate with any sense of symbol table management.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static enum
private static class
pack-priv static enum
IonRawBinaryWriter.PreallocationMode

Determines how container/container-like values should be padded

pack-priv static enum
pack-priv static enum
pack-priv static interface

Field Summary

Modifier and TypeField and Description
private final BlockAllocator
pack-priv IonRawBinaryWriter.ThrowingRunnable
pack-priv boolean
private static final BigInteger
private static final BigInteger
private static final byte
private static final byte
private static final byte
private final WriteBuffer
private static final byte
private boolean
private final _Private_RecyclingStack<IonRawBinaryWriter.ContainerInfo>
private final IntList
private int
private static final byte
private static final byte
private static final byte
private int
private static final byte
pack-priv boolean
private boolean
private boolean
private boolean
private static final byte
private final boolean
private static final byte[]
private static final int
MAX_ANNOTATION_LENGTH

Max supported annotation length specifier size supported.

private static final byte
private static final byte
private static final byte[]
private final OutputStream
private final _Private_RecyclingQueue<IonRawBinaryWriter.PatchPoint>
private static final byte
private final IonRawBinaryWriter.PreallocationMode
private static final int
private final IonRawBinaryWriter.StreamCloseMode
private final IonRawBinaryWriter.StreamFlushMode
private static final byte
private static final byte
private static final byte[]
private static final byte[]
private static final byte
private static final byte
pack-priv final Utf8StringEncoder
private static final byte

Constructor Summary

AccessConstructor and Description
pack-priv
IonRawBinaryWriter(final BlockAllocatorProvider provider, final int blockSize, final OutputStream out, final AbstractIonWriter.WriteValueOptimization optimization, final IonRawBinaryWriter.StreamCloseMode streamCloseMode, final IonRawBinaryWriter.StreamFlushMode streamFlushMode, final IonRawBinaryWriter.PreallocationMode preallocationMode, final boolean isFloatBinary32Enabled, final boolean isAutoFlushEnabled, IonRawBinaryWriter.ThrowingRunnable autoFlush)

Method Summary

Modifier and TypeMethod and Description
private void
addPatchPoint(final IonRawBinaryWriter.ContainerInfo container, final long position, final int oldLength, final long value)

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.

pack-priv void
public void
addTypeAnnotationSymbol(int
- a symbol ID
sid
)

Implements com.amazon.ion.impl.bin._Private_IonRawWriter.addTypeAnnotationSymbol.

Adds the given symbol ID to the list of pending annotation symbol IDs.

private static byte[]
bytes(int... vals)

short-hand for array of bytes--useful for static definitions.

private static void
checkSid(int sid)

private void
public void
close()

Implements com.amazon.ion.IonWriter.close.

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

public void
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.

private void
finishValue()

Closes out annotations.

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.

pack-priv WriteBuffer
public int
getDepth()

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

Returns the current depth of containers the writer is at.

pack-priv int
public SymbolTable
pack-priv boolean
pack-priv boolean
pack-priv boolean
hasWrittenValuesSinceConstructed()

Returns true if a value has been written since the writer was constructed.

pack-priv boolean
hasWrittenValuesSinceFinished()

Returns true if a value has been written since construction or finish().

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.

pack-priv boolean
isIVM(int sid)

private static byte[][]
private static final byte[]
makeTypedPreallocatedBytes(final int typeDesc, final int length)

private void
private IonRawBinaryWriter.ContainerInfo
pack-priv long
private void
prepareValue()

prepare to write values with field name and annotations.

private void
private void
reclaimPlaceholderPatchPoint(int
represents the index of the placeholder patch point.
placeholderPatchIndex
)

This is used to reclaim the placeholder patch point after scan the current container.

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(final SymbolToken
text of the field name
name
)

Implements com.amazon.ion.IonWriter.setFieldNameSymbol.

Sets the pending field name to the given token.

public void
setFieldNameSymbol(int
- a symbol ID
sid
)

Implements com.amazon.ion.impl.bin._Private_IonRawWriter.setFieldNameSymbol.

Sets the current field name to the given symbol ID. It is up to the caller to make sure the given symbol ID has a mapping in the current context's symbol table.

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.

public void
setTypeAnnotationSymbols(int...
- symbol IDs representing the annotation symbols for the current value
sids
)

Implements com.amazon.ion.impl.bin._Private_IonRawWriter.setTypeAnnotationSymbols.

Sets the full list of pending annotations to the given symbol IDs.

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.

pack-priv void
truncate(long position)

private void
updateLength(long length)

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.
offset
,
int
The length of data to write.
length
)

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

Writes a raw value into the buffer, updating lengths appropriately.

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.

private void
writeDecimalValue(final BigDecimal value)

Encodes a decimal, updating the current container length context (which is probably a Decimal/Timestamp).

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(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[]
well-formed UTF-8-encoded 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.

Implements com.amazon.ion.impl.bin._Private_IonRawWriter.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(final SymbolToken
may be null to represent null.symbol.
content
)

Implements com.amazon.ion.IonWriter.writeSymbolToken.

Writes the content of an Ion symbol value.

public void
writeSymbolToken(int
- a symbol ID
sid
)

Implements com.amazon.ion.impl.bin._Private_IonRawWriter.writeSymbolToken.

Directly write the given symbol ID to represent a 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.

private void
writeTypedBytes(final int type, final byte[] data, final int offset, final int length)

Write a raw byte array as some type.

private void
writeTypedUInt(final int type, final long value)

Writes a type descriptor followed by unsigned integer value.

private void
writeVarInt(final long value)

private void
writeVarUInt(final long value)

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