19package org.openoffice.xmerge.converter.palm;
21import java.io.OutputStream;
22import java.io.BufferedOutputStream;
23import java.io.DataOutputStream;
24import java.io.IOException;
76 header.creationDate = (date.getTime() / 1000) +
PdbUtil.TIME_DIFF;
106 public void write(OutputStream os)
throws IOException {
108 BufferedOutputStream bos =
new BufferedOutputStream(os);
109 DataOutputStream dos =
new DataOutputStream(bos);
114 if (
header.numRecords > 0) {
117 int recOffset[] =
new int[
header.numRecords];
118 byte recAttr[] =
new byte[
header.numRecords];
122 recOffset[0] =
PdbUtil.HEADER_SIZE + (
header.numRecords * 8);
124 int lastIndex =
header.numRecords - 1;
125 for (
int i = 0;
i < lastIndex;
i++) {
131 recOffset[
i+1] = recOffset[
i] +
size;
139 for (
int i = 0;
i <
header.numRecords;
i++) {
142 dos.writeInt(recOffset[
i]);
148 int attr = (recAttr[
i] << 24 );
155 for (
int i = 0;
i <
header.numRecords;
i++) {
This class contains data for a single Palm database for use during a conversion process.
int getVersion()
Returns version.
int getCreatorID()
Returns creator ID.
byte[] getPDBNameBytes()
Return the PDB name associated with this object in byte array of exact length of 32 bytes.
short getAttribute()
Returns attribute flag.
int getRecordCount()
Return the number of Records contained in this PDB PalmDB object.
int getTypeID()
Returns type ID.
Record getRecord(int index)
Return the specific Record object associated with the Record number.
Provides functionality to encode a PalmDB object into a PDB formatted file given a file OutputStream.
PdbEncoder(PalmDB db)
Constructor.
static final int START_UNIQUE_ID
The pattern for unique_id=0x00BABE(start).
final PalmDB db
the PalmDB object.
final PdbHeader header
PDB header.
void write(OutputStream os)
Write out a PDB into the given OutputStream.
Contains common static methods and constants for use within the package.
Contains the raw bytes for a Record in a PDB.
int getSize()
This method returns the number of bytes in this object.
byte[] getBytes()
This method returns the contents of this Object.
std::vector< sal_uInt8 > bytes