|
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.PdbEncoder
Provides functionality to encode a PalmDB
object
into a PDB formatted file given a file OutputStream
.
This class is only used by the PalmDB
object.
One needs to create one PdbEncoder
object per
PalmDB
object to be encoded. This class keeps
the PDB header data and functionality in the PdbHeader
class.
Sample usage:
PdbEncoder encoder = new PdbEncoder(palmDB, "STRW", "data"); encoder.write(new FileOutputStream("sample.pdb"));
PalmDB
,
Record
Constructor Summary | |
PdbEncoder(PalmDB db)
Constructor. |
Method Summary | |
void |
write(java.io.OutputStream os)
Write out a PDB into the given OutputStream . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PdbEncoder(PalmDB db)
db
- The PalmDB
to be encoded.Method Detail |
public void write(java.io.OutputStream os) throws java.io.IOException
Write out a PDB into the given OutputStream
.
First, write out the header data by using the
PdbHeader
write
method. Next,
calculate the RecordList section and write it out.
Lastly, write out the bytes corresponding to each
Record
.
The RecordList section contains a list of
Record
index info, where each Record
index info contains:
Record
from the
top of the PDB.Record
attribute.Record
ID.There should be a total of header.numRecords
of Record
index info
os
- OutputStream
to write out PDB.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 |