public final class Transfer
extends java.lang.Object
Transfer
class provides static methods for transfering
data (such as loading and saving). It also contains a general
transfer()
method that might be used to convert data to
other formats without loading the data into memory.
This class is not instantiable.
SerialInput
,
SerialOutput
,
ParseLog
,
MemoryContainer
Modifier and Type | Method | Description |
---|---|---|
static MemoryContainer |
loadIsf(java.io.InputStream stream) |
Loads data in ISF format from a stream into a memory container.
|
static MemoryContainer |
loadIsf(java.io.InputStream stream,
ParseLog log) |
Loads data in ISF format from a stream into a memory container.
|
static MemoryContainer |
loadIsf(java.lang.String filename) |
Loads data from an ISF file into a memory container.
|
static MemoryContainer |
loadIsf(java.lang.String filename,
ParseLog log) |
Loads data from an ISF file into a memory container.
|
static MemoryContainer |
loadXml(java.io.InputStream stream) |
Loads data in XML format from a stream into a memory container.
|
static MemoryContainer |
loadXml(java.io.InputStream stream,
ParseLog log) |
Loads data in XML format from a stream into a memory container.
|
static MemoryContainer |
loadXml(java.lang.String filename) |
Loads data from an XML file into a memory container.
|
static MemoryContainer |
loadXml(java.lang.String filename,
ParseLog log) |
Loads data from an XML file into a memory container.
|
static void |
saveIsf(java.io.OutputStream stream,
MemoryContainer container) |
Saves data contained in a memory container to a stream in ISF format.
|
static void |
saveIsf(java.lang.String filename,
MemoryContainer container) |
Saves data contained in a memory container to an ISF file.
|
static void |
saveSimpleIsf(java.io.OutputStream stream,
MemoryContainer container) |
Saves data contained in a memory container to a stream in ISF format.
|
static void |
saveSimpleIsf(java.lang.String filename,
MemoryContainer container) |
Saves data contained in a memory container to an ISF file.
|
static void |
saveXml(java.io.OutputStream stream,
MemoryContainer container) |
Saves data contained in a memory container to a stream in XML format.
|
static void |
saveXml(java.lang.String filename,
MemoryContainer container) |
Saves data contained in a memory container to an XML file.
|
static void |
transfer(SerialInput input,
SerialOutput output) |
Transfers data from a given input to a given output.
|
public static MemoryContainer loadIsf(java.lang.String filename) throws SerialIOException, java.io.FileNotFoundException
MemoryContainer
, fills it
with data read from the file and returns a reference to the container.filename
- name of an ISF file to be readSerialIOException
- if an error occures during parsing contents
of the filejava.io.FileNotFoundException
- if filename
is not a valid
file namepublic static MemoryContainer loadIsf(java.lang.String filename, ParseLog log) throws SerialIOException, java.io.FileNotFoundException
MemoryContainer
, fills it
with data read from the file and returns reference to the container.
This method enables recording messages from the parser.filename
- name of an ISF file to be readlog
- object capturing messages from the parserSerialIOException
- if an error occures during parsing contents
of the filejava.io.FileNotFoundException
- if filename
is not a valid
file namepublic static MemoryContainer loadIsf(java.io.InputStream stream) throws SerialIOException
MemoryContainer
, fills
it with data read from the file and returns reference to the container.stream
- the stream to read data fromSerialIOException
- if an error occures during parsing contents of
the streampublic static MemoryContainer loadIsf(java.io.InputStream stream, ParseLog log) throws SerialIOException
MemoryContainer
, fills
it with data read from the file and returns reference to the container.
This method enables recording messages from the parser.stream
- the stream to read data fromlog
- object capturing messages from the parserSerialIOException
- if an error occures during parsing contents of
the streampublic static void saveIsf(java.lang.String filename, MemoryContainer container) throws SerialIOException, java.io.FileNotFoundException
filename
- name of an ISF file to be createdcontainer
- memory container containing the data to be savedSerialIOException
- if an error occures during savingjava.io.FileNotFoundException
- if filename
is not a valid
file namepublic static void saveSimpleIsf(java.lang.String filename, MemoryContainer container) throws SerialIOException, java.io.FileNotFoundException
saveIsf
written for back
compatibility with JAMM software and other older programs.filename
- name of an ISF file to be createdcontainer
- memory container containing the data to be savedSerialIOException
- if an error occures during savingjava.io.FileNotFoundException
- if filename
is not a valid
file namepublic static void saveIsf(java.io.OutputStream stream, MemoryContainer container) throws SerialIOException
stream
- the stream to save data tocontainer
- memory container containing the data to be savedSerialIOException
- if an error occures during savingpublic static void saveSimpleIsf(java.io.OutputStream stream, MemoryContainer container) throws SerialIOException
saveIsf
written for back
compatibility with JAMM software and other older programs.stream
- the stream to save data tocontainer
- memory container containing the data to be savedSerialIOException
- if an error occures during savingpublic static MemoryContainer loadXml(java.lang.String filename) throws SerialIOException, java.io.FileNotFoundException
MemoryContainer
, fills it
with data read from the file and returns a reference to the container.filename
- name of an XML file to be readSerialIOException
- if an error occures during parsing contents
of the filejava.io.FileNotFoundException
- if filename
is not a valid
file namepublic static MemoryContainer loadXml(java.lang.String filename, ParseLog log) throws SerialIOException, java.io.FileNotFoundException
MemoryContainer
, fills it
with data read from the file and returns reference to the container.
This method enables recording messages from the parser.filename
- name of an XML file to be readlog
- object capturing messages from the parserSerialIOException
- if an error occures during parsing contents
of the filejava.io.FileNotFoundException
- if filename
is not a valid
file namepublic static MemoryContainer loadXml(java.io.InputStream stream) throws SerialIOException
MemoryContainer
, fills
it with data read from the file and returns reference to the container.stream
- the stream to read data fromSerialIOException
- if an error occures during parsing contents of
the streampublic static MemoryContainer loadXml(java.io.InputStream stream, ParseLog log) throws SerialIOException
MemoryContainer
, fills
it with data read from the file and returns reference to the container.
This method enables recording messages from the parser.stream
- the stream to read data fromlog
- object capturing messages from the parserSerialIOException
- if an error occures during parsing contents of
the streampublic static void saveXml(java.lang.String filename, MemoryContainer container) throws SerialIOException, java.io.FileNotFoundException
filename
- name of an XML file to be createdcontainer
- memory container containing the data to be savedSerialIOException
- if an error occures during savingjava.io.FileNotFoundException
- if filename
is not a valid
file namepublic static void saveXml(java.io.OutputStream stream, MemoryContainer container) throws SerialIOException
stream
- the stream to save data tocontainer
- memory container containing the data to be savedSerialIOException
- if an error occures during savingpublic static void transfer(SerialInput input, SerialOutput output) throws SerialIOException
input
- data sourceoutput
- data destinationSerialIOException
- if an error occures during reading or writting data