LibreOffice Module xmerge (master)  1
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
org.openoffice.xmerge.converter.palm.PdbEncoder Class Reference

Provides functionality to encode a. More...

Collaboration diagram for org.openoffice.xmerge.converter.palm.PdbEncoder:
[legend]

Public Member Functions

 PdbEncoder (PalmDB db)
 Constructor. More...
 
void write (OutputStream os) throws IOException
 Write out a PDB into the given. 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...
 

Detailed Description

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

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"));
See also
PalmDB
Record

Definition at line 44 of file PdbEncoder.java.

Constructor & Destructor Documentation

org.openoffice.xmerge.converter.palm.PdbEncoder.PdbEncoder ( PalmDB  db)
inline

Member Function Documentation

void org.openoffice.xmerge.converter.palm.PdbEncoder.write ( OutputStream  os) throws IOException
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

.

The RecordList section contains a list of

index info, where each

index info contains:

  • 4 bytes local offset of the from the top of the PDB.
  • 1 byte of attribute.
  • 3 bytes unique ID.

There should be a total of

header.numRecords

of

index info.

Parameters
os

Definition at line 106 of file PdbEncoder.java.

References 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(), i, size, and org.openoffice.xmerge.converter.palm.PdbEncoder.START_UNIQUE_ID.

Referenced by org.openoffice.xmerge.converter.palm.PalmDocument.write().

Member Data Documentation

final PalmDB org.openoffice.xmerge.converter.palm.PdbEncoder.db
private

the PalmDB object.

Definition at line 50 of file PdbEncoder.java.

Referenced by org.openoffice.xmerge.converter.palm.PdbEncoder.PdbEncoder().

final PdbHeader org.openoffice.xmerge.converter.palm.PdbEncoder.header
private

PDB header.

Definition at line 47 of file PdbEncoder.java.

final int org.openoffice.xmerge.converter.palm.PdbEncoder.START_UNIQUE_ID = 0x00BABE
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().


The documentation for this class was generated from the following file: