|
OpenOffice.org XMerge API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openoffice.xmerge.converter.palm.PdbDecoder
Provides functionality to decode a PDB formatted file into
a PalmDB
object given an InputStream
.
This class is only used by the PalmDB
object.
Sample usage:
PdbDecoder decoder = new PdbDecoder("sample.pdb"); PalmDB palmDB = decoder.parse();
This decoder has the following assumptions on the PDB file:
Record
indices in the RecordList are sorted in
order, i.e. the first Record
index refers to
Record
0, and so forth.Record
in the Record
section
are sorted as well in order, i.e. first Record
comes ahead of second Record
, etc.Other decoders assume these as well.
PalmDB
,
Record
Constructor Summary | |
PdbDecoder()
|
Method Summary | |
PalmDB |
parse(byte[] b)
This method decodes a PDB file into a PalmDB
object. |
PalmDB |
parse(java.lang.String fileName)
This method decodes a PDB file into a PalmDB
object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PdbDecoder()
Method Detail |
public PalmDB parse(byte[] b) throws java.io.IOException
This method decodes a PDB file into a PalmDB
object.
First, the header data is read using the PdbHeader
read
method. Next, the RecordList section is
read and the Record
offsets are stored for use when
parsing the Records. Based on these offsets, the bytes
corresponding to each Record
are read and each is
stored in a Record
object. Lastly, the data is
used to create a PalmDB
object.
b
- byte[]
containing PDB.java.io.IOException
- If I/O error occurs.public PalmDB parse(java.lang.String fileName) throws java.io.IOException
This method decodes a PDB file into a PalmDB
object.
First, the header data is read using the PdbHeader
read
method. Next, the RecordList section is
read and the Record
offsets are stored for use when
parsing the Records. Based on these offsets, the bytes
corresponding to each Record
are read and each is
stored in a Record
object. Lastly, the data is
used to create a PalmDB
object.
fileName
- PDB file name.java.io.IOException
- If I/O error occurs.
|
OpenOffice.org XMerge API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |