19package org.openoffice.xmerge.converter.palm;
21import java.io.IOException;
22import java.io.ByteArrayInputStream;
23import java.io.DataInputStream;
69 ByteArrayInputStream bais =
new ByteArrayInputStream(b);
70 DataInputStream dis =
new DataInputStream(bais);
73 PdbHeader
header =
new PdbHeader();
77 if (
header.numRecords != 0) {
80 int recOffset[] =
new int[
header.numRecords];
81 byte recAttrs[] =
new byte[
header.numRecords];
83 for (
int i = 0;
i <
header.numRecords;
i++) {
85 recOffset[
i] = dis.readInt();
89 int attr = dis.readInt();
90 recAttrs[
i] = (
byte) (attr >>> 24);
94 int lastIndex =
header.numRecords - 1;
96 for (
int i = 0;
i < lastIndex;
i++) {
100 int nBytesToSkip = recOffset[
i];
101 while (nBytesToSkip > 0) {
102 nBytesToSkip -= dis.skip(nBytesToSkip);
104 int len = recOffset[
i+1] - recOffset[
i];
105 byte[]
bytes =
new byte[len];
106 dis.readFully(
bytes);
112 int len = dis.available() - recOffset[lastIndex];
113 int nBytesToSkip = recOffset[lastIndex];
114 while (nBytesToSkip > 0) {
115 nBytesToSkip -= dis.skip(nBytesToSkip);
117 byte[]
bytes =
new byte[len];
118 dis.readFully(
bytes);
119 recArray[lastIndex] =
new Record(
bytes, recAttrs[lastIndex]);
constexpr sal_Int8 header[]
This class contains data for a single Palm database for use during a conversion process.
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.
Contains the raw bytes for a Record in a PDB.
std::vector< sal_uInt8 > bytes