Class _Private_IonBinaryWriterBuilder
- java.lang.Object
-
- com.amazon.ion.system.IonWriterBuilder
-
- com.amazon.ion.system.IonBinaryWriterBuilder
-
- com.amazon.ion.impl._Private_IonBinaryWriterBuilder
-
public class _Private_IonBinaryWriterBuilder extends IonBinaryWriterBuilder
NOT FOR APPLICATION USE!
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.amazon.ion.system.IonWriterBuilder
IonWriterBuilder.InitialIvmHandling, IonWriterBuilder.IvmMinimizing
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IonWriterbuild(java.io.OutputStream out)Builds a new writer based on this builder's configuration properties.IonBinaryWriterbuildLegacy()Deprecated._Private_IonBinaryWriterBuildercopy()IonCataloggetCatalog()Gets the catalog to use when building anIonWriter.SymbolTable[]getImports()Gets the imports that will be used to construct the initial local symbol table.SymbolTablegetInitialSymbolTable()Gets the symbol table to use for encoded data.ValueFactorygetSymtabValueFactory()_Private_IonBinaryWriterBuilderimmutable()_Private_IonBinaryWriterBuildermutable()protected voidmutationCheck()NOT FOR APPLICATION USE!voidsetCatalog(IonCatalog catalog)Sets the catalog to use when building anIonWriter.voidsetImports(SymbolTable... imports)Sets the shared symbol tables that will be used to construct the initial local symbol table.voidsetInitialSymbolTable(SymbolTable symtab)Declares the symbol table to use for encoded data.voidsetIsFloatBinary32Enabled(boolean enabled)Enables or disables writing Binary32 (4-byte, single precision, IEEE-754) values for floats when there would be no loss in precision.voidsetLocalSymbolTableAppendEnabled(boolean enabled)Enables or disables writing local symbol tables that append symbols to the current symbol table.voidsetStreamCopyOptimized(boolean optimized)Declares whether built writers may attempt to optimizeIonWriter.writeValue(IonReader)by copying raw source data.voidsetSymtabValueFactory(ValueFactory factory)static _Private_IonBinaryWriterBuilderstandard()_Private_IonBinaryWriterBuilderwithFloatBinary32Disabled()Disables writing Binary32 (4-byte, single precision, IEEE-754) values for floats._Private_IonBinaryWriterBuilderwithFloatBinary32Enabled()Enables writing Binary32 (4-byte, single precision, IEEE-754) values for floats when there would be no loss in precision._Private_IonBinaryWriterBuilderwithInitialSymbolTable(SymbolTable symtab)Defaults to $ion_1_0 if null._Private_IonBinaryWriterBuilderwithLocalSymbolTableAppendDisabled()Disables writing local symbol tables that append symbols to the current symbol table._Private_IonBinaryWriterBuilderwithLocalSymbolTableAppendEnabled()Enables writing local symbol tables that append symbols to the current symbol table._Private_IonBinaryWriterBuilderwithSymtabValueFactory(ValueFactory factory)-
Methods inherited from class com.amazon.ion.system.IonBinaryWriterBuilder
getInitialIvmHandling, getIvmMinimizing, isStreamCopyOptimized, withCatalog, withImports, withStreamCopyOptimized
-
-
-
-
Method Detail
-
standard
public static _Private_IonBinaryWriterBuilder standard()
- Returns:
- a new mutable builder.
-
copy
public final _Private_IonBinaryWriterBuilder copy()
- Specified by:
copyin classIonBinaryWriterBuilder
-
immutable
public _Private_IonBinaryWriterBuilder immutable()
- Specified by:
immutablein classIonBinaryWriterBuilder
-
mutable
public _Private_IonBinaryWriterBuilder mutable()
- Specified by:
mutablein classIonBinaryWriterBuilder
-
getSymtabValueFactory
public ValueFactory getSymtabValueFactory()
-
setSymtabValueFactory
public void setSymtabValueFactory(ValueFactory factory)
-
withSymtabValueFactory
public _Private_IonBinaryWriterBuilder withSymtabValueFactory(ValueFactory factory)
-
getInitialSymbolTable
public SymbolTable getInitialSymbolTable()
Description copied from class:IonBinaryWriterBuilderGets the symbol table to use for encoded data. To avoid conflicts between different data streams, if the given instance is mutable, it will be copied whenbuild()is called.- Specified by:
getInitialSymbolTablein classIonBinaryWriterBuilder- Returns:
- a local or system symbol table.
May be null, in which case the initial symbol table is that of
$ion_1_0. - See Also:
IonBinaryWriterBuilder.setInitialSymbolTable(SymbolTable),IonBinaryWriterBuilder.withInitialSymbolTable(SymbolTable)
-
setInitialSymbolTable
public void setInitialSymbolTable(SymbolTable symtab)
Declares the symbol table to use for encoded data. To avoid conflicts between different data streams, if the given instance is mutable, it will be copied whenbuild()is called.- Specified by:
setInitialSymbolTablein classIonBinaryWriterBuilder- Parameters:
symtab- must be a local or system symbol table. May be null, in which case the initial symtab is that of$ion_1_0.- Throws:
SubstituteSymbolTableException- if any imported table is a substitute (seeSymbolTable).- See Also:
IonBinaryWriterBuilder.getInitialSymbolTable(),IonBinaryWriterBuilder.withInitialSymbolTable(SymbolTable)
-
withInitialSymbolTable
public _Private_IonBinaryWriterBuilder withInitialSymbolTable(SymbolTable symtab)
Defaults to $ion_1_0 if null.- Specified by:
withInitialSymbolTablein classIonBinaryWriterBuilder- Parameters:
symtab- may be null.
-
setLocalSymbolTableAppendEnabled
public void setLocalSymbolTableAppendEnabled(boolean enabled)
Description copied from class:IonBinaryWriterBuilderEnables or disables writing local symbol tables that append symbols to the current symbol table. This functionality is disabled by default.- Specified by:
setLocalSymbolTableAppendEnabledin classIonBinaryWriterBuilder
-
withLocalSymbolTableAppendEnabled
public _Private_IonBinaryWriterBuilder withLocalSymbolTableAppendEnabled()
Description copied from class:IonBinaryWriterBuilderEnables writing local symbol tables that append symbols to the current symbol table. This functionality is disabled by default.- Specified by:
withLocalSymbolTableAppendEnabledin classIonBinaryWriterBuilder
-
withLocalSymbolTableAppendDisabled
public _Private_IonBinaryWriterBuilder withLocalSymbolTableAppendDisabled()
Description copied from class:IonBinaryWriterBuilderDisables writing local symbol tables that append symbols to the current symbol table. This functionality is disabled by default.- Specified by:
withLocalSymbolTableAppendDisabledin classIonBinaryWriterBuilder
-
setIsFloatBinary32Enabled
public void setIsFloatBinary32Enabled(boolean enabled)
Description copied from class:IonBinaryWriterBuilderEnables or disables writing Binary32 (4-byte, single precision, IEEE-754) values for floats when there would be no loss in precision. By default Binary32 support is disabled to ensure the broadest compatibility with existing Ion implementations. Historically, implementations were only able to read Binary64 values.When 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).
- Specified by:
setIsFloatBinary32Enabledin classIonBinaryWriterBuilder- Parameters:
enabled-trueto enable writing 4-byte floats,falseto always write 8-byte floats.- See Also:
IonBinaryWriterBuilder.withFloatBinary32Enabled(),IonBinaryWriterBuilder.withFloatBinary32Disabled()
-
withFloatBinary32Enabled
public _Private_IonBinaryWriterBuilder withFloatBinary32Enabled()
Description copied from class:IonBinaryWriterBuilderEnables writing Binary32 (4-byte, single precision, IEEE-754) values for floats when there would be no loss in precision. By default Binary32 support is disabled to ensure the broadest compatibility with existing Ion implementations. Historically, implementations were only able to read Binary64 values.When 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).
-
withFloatBinary32Disabled
public _Private_IonBinaryWriterBuilder withFloatBinary32Disabled()
Description copied from class:IonBinaryWriterBuilderDisables writing Binary32 (4-byte, single precision, IEEE-754) values for floats. This is the default behavior.When 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.
-
setImports
public void setImports(SymbolTable... imports)
Sets the shared symbol tables that will be used to construct the initial local symbol table.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.- Parameters:
imports- a sequence of shared symbol tables. The first (and only the first) may be a system table.- See Also:
getImports(),withImports(SymbolTable...)
-
setCatalog
public void setCatalog(IonCatalog catalog)
Sets the catalog to use when building anIonWriter.- Parameters:
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.- See Also:
getCatalog(),withCatalog(IonCatalog)
-
setStreamCopyOptimized
public void setStreamCopyOptimized(boolean optimized)
Description copied from class:IonBinaryWriterBuilderDeclares whether built writers may attempt to optimizeIonWriter.writeValue(IonReader)by copying raw source data. By default, this property is false.This feature is experimental! Please test thoroughly and report any issues.
-
build
public final IonWriter build(java.io.OutputStream out)
Description copied from class:IonWriterBuilderBuilds a new writer based on this builder's configuration properties.- Specified by:
buildin classIonWriterBuilder- Parameters:
out- the stream that will receive Ion data. Must not be null.- Returns:
- a new
IonWriterinstance; notnull.
-
buildLegacy
@Deprecated public final IonBinaryWriter buildLegacy()
Deprecated.
-
mutationCheck
protected void mutationCheck()
NOT FOR APPLICATION USE!
-
getCatalog
public final IonCatalog getCatalog()
Gets the catalog to use when building anIonWriter. The catalog is needed to resolve manually-written imports (not common). By default, this property is null.- See Also:
setCatalog(IonCatalog),withCatalog(IonCatalog)
-
getImports
public final SymbolTable[] getImports()
Gets the imports that will be used to construct the initial local symbol table.- Returns:
- may be null or empty.
- See Also:
setImports(SymbolTable...),withImports(SymbolTable...)
-
-