Top Description Methods
com.amazon.ion

public Interface IonLoader

Known Direct Implementers
com.amazon.ion.impl.lite.IonLoaderLite
Imports
java.io.File, .IOException, .InputStream, .Reader

Loads Ion data in the form of datagrams. These methods parse the input in its entirety to identify problems immediately. In contrast, an IonReader will parse one top-level value at a time, and is better suited for streaming protocols or large inputs.

Warning

This interface should not be implemented or extended by code outside of this library.

Implementations of this interface are safe for use by multiple threads.

See Also
IonReader

Method Summary

Modifier and TypeMethod and Description
public IonCatalog

Returns:

a catalog; not null.
getCatalog
()

Gets the IonCatalog being used by this loader.

public IonSystem

Returns:

the system instance; not null.
getSystem
()

Gets the IonSystem from which this loader was created.

public IonDatagram

Returns:

a datagram containing all the values in the file; not null.
load
(File
a file containing Ion data.
ionFile
)

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

public IonDatagram

Returns:

a datagram containing the input values; not null.
load
(String
must not be null.
ionText
)

Loads Ion text in its entirety.

public IonDatagram

Returns:

a datagram containing all the elements on the input stream; not null.
load
(Reader
the reader from which to read Ion text.
ionText
)

Loads a stream of Ion text into a single datagram.

public IonDatagram

Returns:

a datagram containing all the values on the input stream; not null.
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
)

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

public IonDatagram

Returns:

a datagram containing all the values on the input stream; not null.
load
(InputStream
the stream from which to read Ion data.
ionData
)
Deprecated Will cause a memory leak when reading a gzipped stream. Use IonLoader#load(IonReader) instead.

Warning

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

public IonDatagram

Returns:

a datagram containing all the values on the reader; not null.
load
(IonReader
@param reader source of the Ion data to load.
reader
)

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

Method Detail

getCatalogback to summary
public IonCatalog getCatalog()

Gets the IonCatalog being used by this loader.

Returns:IonCatalog

a catalog; not null.

getSystemback to summary
public IonSystem 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

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

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.
NullPointerException:
if ionText is null.
loadback to summary
public IonDatagram load(Reader ionText) throws IonException, IOException

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.
NullPointerException:
if ionText is null.
loadback to summary
public IonDatagram load(byte[] ionData) throws IonException

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.
NullPointerException:
if ionData is null.
loadback to summary
public IonDatagram load(InputStream ionData) throws IonException, IOException

Deprecated

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

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.

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

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.
NullPointerException:
if reader is null.