Interface IonLoader
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:
-
Method Summary
Modifier and TypeMethodDescriptionGets theIonCatalogbeing used by this loader.Gets theIonSystemfrom which this loader was created.load(byte[] ionData) Loads a block of Ion data into a single datagram, detecting whether it's text or binary data.Loads an entire stream of Ion data into a single datagram, detecting whether it's text or binary data.Loads an entire file of Ion data into a single datagram, detecting whether it's text or binary data.load(InputStream ionData) Deprecated.Will cause a memory leak when reading a gzipped stream.Loads a stream of Ion text into a single datagram.Loads Ion text in its entirety.
-
Method Details
-
getSystem
IonSystem getSystem()Gets theIonSystemfrom which this loader was created.- Returns:
- the system instance; not
null.
-
getCatalog
IonCatalog getCatalog()Gets theIonCatalogbeing used by this loader.- Returns:
- a catalog; not null.
-
load
Loads an entire file of Ion data into a single datagram, detecting whether it's text or binary data.- Parameters:
ionFile- a file containing Ion data.- Returns:
- a datagram containing all the values in the file; not null.
- Throws:
IonException- if there's a syntax error in the Ion content.IOException- if reading from the specified file results in anIOException.
-
load
Loads Ion text in its entirety.- Parameters:
ionText- must not be null.- Returns:
- a datagram containing the input values; not null.
- Throws:
NullPointerException- ifionTextis null.IonException- if there's a syntax error in the Ion content.
-
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- the reader from which to read Ion text.- Returns:
- a datagram containing all the elements on the input stream; not null.
- Throws:
NullPointerException- ifionTextis null.IonException- if there's a syntax error in the Ion content.IOException- if reading from the specified input stream results in anIOException.
-
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- 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:
- a datagram containing all the values on the input stream; not null.
- Throws:
NullPointerException- ifionDatais null.IonException- if there's a syntax error in the Ion content.
-
load
Deprecated.Will cause a memory leak when reading a gzipped stream. Useload(IonReader)instead.WARNING: Will cause a memory leak when reading a gzipped stream, use
Loads an entire stream of Ion data into a single datagram, detecting whether it's text or binary data.load(IonReader)instead.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- the stream from which to read Ion data.- Returns:
- a datagram containing all the values on the input stream; not null.
- Throws:
NullPointerException- ifionDatais null.IonException- if there's a syntax error in the Ion content.IOException- if reading from the specified input stream results in anIOException.
-
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- @param reader source of the Ion data to load.- Returns:
- a datagram containing all the values on the reader; not null.
- Throws:
NullPointerException- ifreaderis null.IonException- if there's a syntax error in the Ion content.
-