LibreOffice Module xmerge (master) 1
|
Provides functionality to encode a PalmDB
object into a PDB formatted file given a file OutputStream
.
More...
Public Member Functions | |
PdbEncoder (PalmDB db) | |
Constructor. More... | |
void | write (OutputStream os) throws IOException |
Write out a PDB into the given OutputStream . More... | |
Private Attributes | |
final PdbHeader | header |
PDB header. More... | |
final PalmDB | db |
the PalmDB object. More... | |
Static Private Attributes | |
static final int | START_UNIQUE_ID = 0x00BABE |
The pattern for unique_id=0x00BABE(start). More... | |
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"));
Definition at line 44 of file PdbEncoder.java.
|
inline |
Constructor.
db | The PalmDB to be encoded. |
Definition at line 61 of file PdbEncoder.java.
References Date, org.openoffice.xmerge.converter.palm.PdbEncoder.db, org.openoffice.xmerge.converter.palm.PalmDB.getAttribute(), org.openoffice.xmerge.converter.palm.PalmDB.getCreatorID(), org.openoffice.xmerge.converter.palm.PalmDB.getPDBNameBytes(), org.openoffice.xmerge.converter.palm.PalmDB.getRecordCount(), org.openoffice.xmerge.converter.palm.PalmDB.getTypeID(), org.openoffice.xmerge.converter.palm.PalmDB.getVersion(), and org.openoffice.xmerge.converter.palm.PdbEncoder.header.
|
inline |
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. |
IOException | If I/O error occurs. |
Definition at line 106 of file PdbEncoder.java.
References org.openoffice.xmerge.converter.palm.PdbEncoder.db, org.openoffice.xmerge.converter.palm.Record.getAttributes(), org.openoffice.xmerge.converter.palm.Record.getBytes(), org.openoffice.xmerge.converter.palm.PalmDB.getRecord(), org.openoffice.xmerge.converter.palm.Record.getSize(), org.openoffice.xmerge.converter.palm.PdbEncoder.header, i, size, and org.openoffice.xmerge.converter.palm.PdbEncoder.START_UNIQUE_ID.
Referenced by org.openoffice.xmerge.converter.palm.PalmDocument.write().
|
private |
the PalmDB object.
Definition at line 50 of file PdbEncoder.java.
Referenced by org.openoffice.xmerge.converter.palm.PdbEncoder.PdbEncoder(), and org.openoffice.xmerge.converter.palm.PdbEncoder.write().
|
private |
PDB header.
Definition at line 47 of file PdbEncoder.java.
Referenced by org.openoffice.xmerge.converter.palm.PdbEncoder.PdbEncoder(), and org.openoffice.xmerge.converter.palm.PdbEncoder.write().
|
staticprivate |
The pattern for unique_id=0x00BABE(start).
Definition at line 53 of file PdbEncoder.java.
Referenced by org.openoffice.xmerge.converter.palm.PdbEncoder.write().