19package org.openoffice.xmerge.converter.palm;
21import java.io.IOException;
22import java.io.InputStream;
23import java.io.ByteArrayOutputStream;
25import java.io.OutputStream;
26import java.io.UnsupportedEncodingException;
71 public PalmDocument(String name,
int creatorID,
int typeID,
int version,
72 short attribute,
Record[] recs)
73 throws UnsupportedEncodingException {
85 public void read(InputStream is)
throws IOException {
87 ByteArrayOutputStream baos =
new ByteArrayOutputStream();
88 byte[] buf =
new byte[4096];
90 while ((
n = is.read(buf)) > 0) {
91 baos.write(buf, 0,
n);
93 byte[] bytearr = baos.toByteArray();
105 public void write(OutputStream os)
throws IOException {
This class contains data for a single Palm database for use during a conversion process.
String getPDBNameString()
Return the PDB name associated with this object.
A PalmDocument is palm implementation of the Document interface.
void write(OutputStream os)
Writes the PalmDocument to an OutputStream.
PalmDB getPdb()
Returns the PalmDB contained in this object.
void setPdb(PalmDB pdb)
Sets the PalmDocument to a new PalmDB value.
PalmDocument(InputStream is)
Constructor to create a PalmDocument from an InputStream.
String getFileName()
Returns the name of the file.
String getName()
Returns the Document name.
String fileName
The file name.
void read(InputStream is)
Reads in a file from the InputStream.
PalmDB pdb
The internal representation of a pdb.
PalmDocument(String name, int creatorID, int typeID, int version, short attribute, Record[] recs)
Constructor to create a PalmDocument with Record objects.
Provides functionality to decode a PDB formatted file into a PalmDB object given an InputStream.
PalmDB parse(byte[] b)
This method decodes a PDB file into a PalmDB object.
Provides functionality to encode a PalmDB object into a PDB formatted file given a file OutputStream.
void write(OutputStream os)
Write out a PDB into the given OutputStream.
Contains the raw bytes for a Record in a PDB.
A Document represents any Document to be converted and the resulting Document from any conversion.
Provides interfaces for converting between two Document formats, and supports a "merge" interface for...