public class _Private_IonBinaryWriterBuilder extends IonBinaryWriterBuilder
IonWriterBuilder.InitialIvmHandling, IonWriterBuilder.IvmMinimizing| Modifier and Type | Method and Description |
|---|---|
IonWriter |
build(java.io.OutputStream out)
Builds a new writer based on this builder's configuration
properties.
|
IonBinaryWriter |
buildLegacy()
Deprecated.
|
_Private_IonBinaryWriterBuilder |
copy()
Creates a mutable copy of this builder.
|
IonCatalog |
getCatalog()
Gets the catalog to use when building an
IonWriter. |
SymbolTable[] |
getImports()
Gets the imports that will be used to construct the initial local
symbol table.
|
SymbolTable |
getInitialSymbolTable()
Gets the symbol table to use for encoded data.
|
ValueFactory |
getSymtabValueFactory() |
_Private_IonBinaryWriterBuilder |
immutable()
Returns an immutable builder configured exactly like this one.
|
_Private_IonBinaryWriterBuilder |
mutable()
Returns a mutable builder configured exactly like this one.
|
protected void |
mutationCheck()
NOT FOR APPLICATION USE!
|
void |
setAutoFlushEnabled(boolean autoFlushEnabled) |
void |
setBlockSize(int size) |
void |
setCatalog(IonCatalog catalog)
Sets the catalog to use when building an
IonWriter. |
void |
setImports(SymbolTable... imports)
Sets the shared symbol tables that will be used to construct the
initial local symbol table.
|
void |
setInitialSymbolTable(SymbolTable symtab)
Declares the symbol table to use for encoded data.
|
void |
setIsFloatBinary32Enabled(boolean enabled)
Enables or disables writing Binary32 (4-byte, single precision,
IEEE-754) values for floats when there would be no loss in precision.
|
void |
setLocalSymbolTableAppendEnabled(boolean enabled)
Enables or disables writing local symbol tables that append symbols
to the current symbol table.
|
void |
setStreamCopyOptimized(boolean optimized)
Declares whether built writers may attempt to optimize
IonWriter.writeValue(IonReader) by copying raw source data. |
void |
setSymtabValueFactory(ValueFactory factory) |
static _Private_IonBinaryWriterBuilder |
standard() |
_Private_IonBinaryWriterBuilder |
withAutoFlushEnabled(boolean autoFlushEnabled)
Auto-flush enables automatic execution of flush operations during the write process.
|
_Private_IonBinaryWriterBuilder |
withBlockSize(int size)
Specify the block size for write buffer.
|
_Private_IonBinaryWriterBuilder |
withFloatBinary32Disabled()
Disables writing Binary32 (4-byte, single precision, IEEE-754) values for
floats.
|
_Private_IonBinaryWriterBuilder |
withFloatBinary32Enabled()
Enables writing Binary32 (4-byte, single precision, IEEE-754) values
for floats when there would be no loss in precision.
|
_Private_IonBinaryWriterBuilder |
withInitialSymbolTable(SymbolTable symtab)
Defaults to $ion_1_0 if null.
|
_Private_IonBinaryWriterBuilder |
withLocalSymbolTableAppendDisabled()
Disables writing local symbol tables that append symbols to the current
symbol table.
|
_Private_IonBinaryWriterBuilder |
withLocalSymbolTableAppendEnabled()
Enables writing local symbol tables that append symbols to the current
symbol table.
|
_Private_IonBinaryWriterBuilder |
withSymtabValueFactory(ValueFactory factory) |
getInitialIvmHandling, getIvmMinimizing, isStreamCopyOptimized, withCatalog, withImports, withStreamCopyOptimizedpublic static _Private_IonBinaryWriterBuilder standard()
public final _Private_IonBinaryWriterBuilder copy()
copy in class IonBinaryWriterBuilderthis.public _Private_IonBinaryWriterBuilder immutable()
immutable in class IonBinaryWriterBuilderpublic _Private_IonBinaryWriterBuilder mutable()
mutable in class IonBinaryWriterBuilderpublic ValueFactory getSymtabValueFactory()
public void setSymtabValueFactory(ValueFactory factory)
public _Private_IonBinaryWriterBuilder withSymtabValueFactory(ValueFactory factory)
public SymbolTable getInitialSymbolTable()
IonBinaryWriterBuilderbuild() is called.getInitialSymbolTable in class IonBinaryWriterBuilder$ion_1_0.IonBinaryWriterBuilder.setInitialSymbolTable(SymbolTable),
IonBinaryWriterBuilder.withInitialSymbolTable(SymbolTable)public void setInitialSymbolTable(SymbolTable symtab)
build() is called.setInitialSymbolTable in class IonBinaryWriterBuildersymtab - must be a local or system symbol table.
May be null, in which case the initial symtab is that of
$ion_1_0.SubstituteSymbolTableException - if any imported table is a substitute (see SymbolTable).IonBinaryWriterBuilder.getInitialSymbolTable(),
IonBinaryWriterBuilder.withInitialSymbolTable(SymbolTable)public _Private_IonBinaryWriterBuilder withInitialSymbolTable(SymbolTable symtab)
withInitialSymbolTable in class IonBinaryWriterBuildersymtab - may be null.public _Private_IonBinaryWriterBuilder withAutoFlushEnabled(boolean autoFlushEnabled)
IonBinaryWriterBuilderHere is where you can set up the
block size of write buffer.
Auto-flush is disabled by default and the default block size is 32K.withAutoFlushEnabled in class IonBinaryWriterBuilderautoFlushEnabled - A boolean parameter indicating whether this functionality is enabled or not.public void setAutoFlushEnabled(boolean autoFlushEnabled)
public void setLocalSymbolTableAppendEnabled(boolean enabled)
IonBinaryWriterBuildersetLocalSymbolTableAppendEnabled in class IonBinaryWriterBuilderpublic _Private_IonBinaryWriterBuilder withLocalSymbolTableAppendEnabled()
IonBinaryWriterBuilderwithLocalSymbolTableAppendEnabled in class IonBinaryWriterBuilderpublic _Private_IonBinaryWriterBuilder withLocalSymbolTableAppendDisabled()
IonBinaryWriterBuilderwithLocalSymbolTableAppendDisabled in class IonBinaryWriterBuilderpublic _Private_IonBinaryWriterBuilder withBlockSize(int size)
IonBinaryWriterBuilderwithBlockSize in class IonBinaryWriterBuildersize - represent the specified block size in bytes.
If this functionality is not set, the default block size is 32768 bytes.public void setIsFloatBinary32Enabled(boolean enabled)
IonBinaryWriterBuilderWhen enabled, floats are evaluated for a possible loss of data at single precision. If the value can be represented in single precision without data loss, it is written as a 4-byte, Binary32 value. Floats which cannot be represented as single-precision values are written as 8-byte, Binary64 values (this is the legacy behavior for all floats, regardless of value).
setIsFloatBinary32Enabled in class IonBinaryWriterBuilderenabled - true to enable writing 4-byte floats,
false to always write 8-byte floats.IonBinaryWriterBuilder.withFloatBinary32Enabled(),
IonBinaryWriterBuilder.withFloatBinary32Disabled()public _Private_IonBinaryWriterBuilder withFloatBinary32Enabled()
IonBinaryWriterBuilderWhen enabled, floats are evaluated for a possible loss of data at single precision. If the value can be represented in single precision without data loss, it is written as a 4-byte, Binary32 value. Floats which cannot be represented as single-precision values are written as 8-byte, Binary64 values (this is the legacy behavior for all floats, regardless of value).
public _Private_IonBinaryWriterBuilder withFloatBinary32Disabled()
IonBinaryWriterBuilderWhen disabled, floats are always written as 8-byte, Binary64 values regardless of value. This is the legacy behavior for all Ion binary writers and ensures the boarded compatibility with other Ion consumers.
public void setImports(SymbolTable... imports)
If the imports sequence is not null and not empty, the output stream
will be bootstrapped with a local symbol table that uses the given
imports.
imports - a sequence of shared symbol tables.
The first (and only the first) may be a system table.getImports(),
withImports(SymbolTable...)public void setCatalog(IonCatalog catalog)
IonWriter.catalog - the catalog to use in built writers.
If null, the writer will be unable to resolve manually-written imports
and may throw an exception.getCatalog(),
withCatalog(IonCatalog)public void setStreamCopyOptimized(boolean optimized)
IonBinaryWriterBuilderIonWriter.writeValue(IonReader) by copying raw source data.
By default, this property is false.
This feature is experimental! Please test thoroughly and report any issues.
public void setBlockSize(int size)
public final IonWriter build(java.io.OutputStream out)
IonWriterBuilderbuild in class IonWriterBuilderout - the stream that will receive Ion data.
Must not be null.IonWriter instance; not null.@Deprecated public final IonBinaryWriter buildLegacy()
protected void mutationCheck()
public final IonCatalog getCatalog()
IonWriter.
The catalog is needed to resolve manually-written imports (not common).
By default, this property is null.setCatalog(IonCatalog),
withCatalog(IonCatalog)public final SymbolTable[] getImports()
setImports(SymbolTable...),
withImports(SymbolTable...)