Top Description Constructors Methods
com.amazon.ion.impl

public final Class _Private_IonBinaryWriterImpl

extends IonWriterUserBinary
implements IonBinaryWriter
Class Inheritance
All Implemented Interfaces
com.amazon.ion.IonBinaryWriter, com.amazon.ion.IonWriter, com.amazon.ion.facet.Faceted, java.io.Flushable, java.io.Closeable, java.lang.AutoCloseable
Annotations
@Deprecated
Imports
com.amazon.ion.IonBinaryWriter, .IonException, .IonWriter, com.amazon.ion.impl.BlockedBuffer.BufferedOutputStream, java.io.IOException, .OutputStream

Deprecated

NOT FOR APPLICATION USE!

Adapts the binary IonWriter implementation to the deprecated IonBinaryWriter interface.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
byteSize()

Implements com.amazon.ion.IonBinaryWriter.byteSize.

Gets the size in bytes of this binary data.

public byte[]
getBytes()

Implements com.amazon.ion.IonBinaryWriter.getBytes.

Copies the current contents of this writer as a new byte array holding Ion binary-encoded data.

public int
getBytes(byte[]
users byte array to write into
bytes
,
int
initial offset in the array to write into
offset
,
int
maximum number of bytes to write
len
)

Implements com.amazon.ion.IonBinaryWriter.getBytes.

Copies the current contents of the writer to a given byte array array.

private BlockedBuffer.BufferedOutputStream
public int
writeBytes(OutputStream
OutputStream to write the bytes to
userstream
)

Implements com.amazon.ion.IonBinaryWriter.writeBytes.

Writes the current contents of the writer to the output stream.

Inherited from com.amazon.ion.impl.IonWriterUserBinary:
isStreamCopyOptimizedwriteBoolListwriteFloatListwriteFloatListwriteIntListwriteIntListwriteIntListwriteIntListwriteStringListwriteValue

Constructor Detail

_Private_IonBinaryWriterImplback to summary
pack-priv _Private_IonBinaryWriterImpl(_Private_IonBinaryWriterBuilder options, IonWriterSystemBinary systemWriter)

Method Detail

byteSizeback to summary
public int byteSize()

Implements com.amazon.ion.IonBinaryWriter.byteSize.

Doc from com.amazon.ion.IonBinaryWriter.byteSize.

Gets the size in bytes of this binary data. This is generally needed before calling getBytes() or getBytes(byte[], int, int).

Returns:int

the size in bytes.

getBytesback to summary
public byte[] getBytes() throws IOException

Implements com.amazon.ion.IonBinaryWriter.getBytes.

Doc from com.amazon.ion.IonBinaryWriter.getBytes.

Copies the current contents of this writer as a new byte array holding Ion binary-encoded data. This allocates an array of the size needed to exactly hold the output and copies the entire value to it.

Returns:byte[]

the byte array with the writers output

getBytesback to summary
public int getBytes(byte[] bytes, int offset, int len) throws IOException

Implements com.amazon.ion.IonBinaryWriter.getBytes.

Doc from com.amazon.ion.IonBinaryWriter.getBytes.

Copies the current contents of the writer to a given byte array array. This starts writing to the array at offset and writes up to maxlen bytes. If this writer is not able to stop in the middle of its work this may overwrite the array and later throw and exception.

Parameters
bytes:byte[]

users byte array to write into

offset:int

initial offset in the array to write into

len:int

maximum number of bytes to write

Returns:int

number of bytes written

getOutputStreamback to summary
private BlockedBuffer.BufferedOutputStream getOutputStream()
writeBytesback to summary
public int writeBytes(OutputStream userstream) throws IOException

Implements com.amazon.ion.IonBinaryWriter.writeBytes.

Doc from com.amazon.ion.IonBinaryWriter.writeBytes.

Writes the current contents of the writer to the output stream. This is only valid if the writer is not in the middle of writing a container.

Parameters
userstream:OutputStream

OutputStream to write the bytes to

Returns:int

int length of bytes written