Top Fields Constructors Methods
com.amazon.ion.impl.lite

pack-priv final Class IonLoaderLite

extends Object
implements IonLoader
Class Inheritance
All Implemented Interfaces
com.amazon.ion.IonLoader
Imports
com.amazon.ion.IonCatalog, .IonCursor, .IonDatagram, .IonException, .IonLoader, .IonReader, .IonSystem, .IonWriter, com.amazon.ion.impl._Private_IonWriterFactory, com.amazon.ion.system.IonReaderBuilder, java.io.File, .FileInputStream, .IOException, .InputStream, .Reader

Field Summary

Modifier and TypeField and Description
private final IonCatalog
_catalog

Not null.

private final IonReaderBuilder
private final IonSystemLite

Constructor Summary

AccessConstructor and Description
public
IonLoaderLite(IonSystemLite
must not be null.
system
,
IonCatalog
must not be null.
catalog
)

Method Summary

Modifier and TypeMethod and Description
public IonCatalog
getCatalog()

Implements com.amazon.ion.IonLoader.getCatalog.

Gets the IonCatalog being used by this loader.

public IonSystem
getSystem()

Implements com.amazon.ion.IonLoader.getSystem.

Gets the IonSystem from which this loader was created.

public IonDatagram
load(File
a file containing Ion data.
ionFile
)

Implements com.amazon.ion.IonLoader.load.

Loads an entire file of Ion data into a single datagram, detecting whether it's text or binary data.

public IonDatagram
load(String
must not be null.
ionText
)

Implements com.amazon.ion.IonLoader.load.

Loads Ion text in its entirety.

public IonDatagram
load(Reader
the reader from which to read Ion text.
ionText
)

Implements com.amazon.ion.IonLoader.load.

Loads a stream of Ion text into a single datagram.

public IonDatagram
load(byte[]
may be either Ion binary data, or UTF-8 Ion text. This method assumes ownership of the array and may modify it at will.
ionData
)

Implements com.amazon.ion.IonLoader.load.

Loads a block of Ion data into a single datagram, detecting whether it's text or binary data.

public IonDatagram
load(InputStream
the stream from which to read Ion data.
ionData
)

Implements com.amazon.ion.IonLoader.load.

Warning

Will cause a memory leak when reading a gzipped stream, use IonLoader#load(IonReader) instead.

public IonDatagram
load(IonReader
@param reader source of the Ion data to load.
reader
)

Implements com.amazon.ion.IonLoader.load.

Loads an entire stream of Ion data into a single datagram, detecting whether it's text or binary data.

private IonDatagramLite

Returns:

a new datagram; not null.
load_helper
(IonReader reader)

This doesn't wrap IOException because some callers need to propagate it.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_catalogback to summary
private final IonCatalog _catalog

Not null.

_readerBuilderback to summary
private final IonReaderBuilder _readerBuilder
_systemback to summary
private final IonSystemLite _system

Constructor Detail

IonLoaderLiteback to summary
public IonLoaderLite(IonSystemLite system, IonCatalog catalog)
Parameters
system:IonSystemLite

must not be null.

catalog:IonCatalog

must not be null.

Method Detail

getCatalogback to summary
public IonCatalog getCatalog()

Implements com.amazon.ion.IonLoader.getCatalog.

Doc from com.amazon.ion.IonLoader.getCatalog.

Gets the IonCatalog being used by this loader.

Returns:IonCatalog

a catalog; not null.

getSystemback to summary
public IonSystem getSystem()

Implements com.amazon.ion.IonLoader.getSystem.

Doc from com.amazon.ion.IonLoader.getSystem.

Gets the IonSystem from which this loader was created.

Returns:IonSystem

the system instance; not null.

loadback to summary
public IonDatagram load(File ionFile) throws IonException, IOException

Implements com.amazon.ion.IonLoader.load.

Doc from com.amazon.ion.IonLoader.load.

Loads an entire file of Ion data into a single datagram, detecting whether it's text or binary data.

Parameters
ionFile:File

a file containing Ion data.

Returns:IonDatagram

a datagram containing all the values in the file; not null.

Exceptions
IonException:
if there's a syntax error in the Ion content.
IOException:
if reading from the specified file results in an IOException.
loadback to summary
public IonDatagram load(String ionText) throws IonException

Implements com.amazon.ion.IonLoader.load.

Doc from com.amazon.ion.IonLoader.load.

Loads Ion text in its entirety.

Parameters
ionText:String

must not be null.

Returns:IonDatagram

a datagram containing the input values; not null.

Exceptions
IonException:
if there's a syntax error in the Ion content.
loadback to summary
public IonDatagram load(Reader ionText) throws IonException, IOException

Implements com.amazon.ion.IonLoader.load.

Doc from com.amazon.ion.IonLoader.load.

Loads a stream of Ion text into a single datagram.

The specified reader remains open after this method returns.

Because this library performs its own buffering, it's recommended that you avoid adding additional buffering to the given stream.

Parameters
ionText:Reader

the reader from which to read Ion text.

Returns:IonDatagram

a datagram containing all the elements on the input stream; not null.

Exceptions
IonException:
if there's a syntax error in the Ion content.
IOException:
if reading from the specified input stream results in an IOException.
loadback to summary
public IonDatagram load(byte[] ionData) throws IonException

Implements com.amazon.ion.IonLoader.load.

Doc from com.amazon.ion.IonLoader.load.

Loads a block of Ion data into a single datagram, detecting whether it's text or binary data.

This method will auto-detect and uncompress GZIPped Ion data.

Parameters
ionData:byte[]

may be either Ion binary data, or UTF-8 Ion text. This method assumes ownership of the array and may modify it at will.

Returns:IonDatagram

a datagram containing all the values on the input stream; not null.

Exceptions
IonException:
if there's a syntax error in the Ion content.
loadback to summary
public IonDatagram load(InputStream ionData) throws IonException, IOException

Implements com.amazon.ion.IonLoader.load.

Doc from com.amazon.ion.IonLoader.load.

Warning

Will cause a memory leak when reading a gzipped stream, use IonLoader#load(IonReader) instead.

Loads an entire stream of Ion data into a single datagram, detecting whether it's text or binary data.

The specified stream remains open after this method returns.

This method will auto-detect and uncompress GZIPped Ion data.

Because this library performs its own buffering, it's recommended that you avoid adding additional buffering to the given stream.

Parameters
ionData:InputStream

the stream from which to read Ion data.

Returns:IonDatagram

a datagram containing all the values on the input stream; not null.

Exceptions
IonException:
if there's a syntax error in the Ion content.
IOException:
if reading from the specified input stream results in an IOException.
loadback to summary
public IonDatagram load(IonReader reader) throws IonException

Implements com.amazon.ion.IonLoader.load.

Doc from com.amazon.ion.IonLoader.load.

Loads an entire stream of Ion data into a single datagram, detecting whether it's text or binary data.

The specified reader remains open after this method returns.

Parameters
reader:IonReader

@param reader source of the Ion data to load.

Returns:IonDatagram

a datagram containing all the values on the reader; not null.

Exceptions
IonException:
if there's a syntax error in the Ion content.
load_helperback to summary
private IonDatagramLite load_helper(IonReader reader) throws IOException

This doesn't wrap IOException because some callers need to propagate it.

Returns:IonDatagramLite

a new datagram; not null.