LibreOffice Module xmerge (master)  1
PdbHeader.java
Go to the documentation of this file.
1 /*
2  * This file is part of the LibreOffice project.
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  *
8  * This file incorporates work covered by the following license notice:
9  *
10  * Licensed to the Apache Software Foundation (ASF) under one or more
11  * contributor license agreements. See the NOTICE file distributed
12  * with this work for additional information regarding copyright
13  * ownership. The ASF licenses this file to you under the Apache
14  * License, Version 2.0 (the "License"); you may not use this file
15  * except in compliance with the License. You may obtain a copy of
16  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
17  */
18 
19 package org.openoffice.xmerge.converter.palm;
20 
21 import java.io.DataInput;
22 import java.io.DataOutput;
23 import java.io.IOException;
24 
40 final class PdbHeader {
41 
43  byte[] pdbName = null;
44 
48  short attribute = 0;
49 
51  int version = 0;
52 
54  long creationDate = 0;
55 
57  long modificationDate = 0;
58 
60  private long lastBackupDate = 0;
61 
66  private long modificationNumber = 0;
67 
69  private int appInfoID = 0;
70 
72  private int sortInfoID = 0;
73 
75  int typeID = 0;
76 
78  int creatorID = 0;
79 
81  private int uniqueIDSeed = 0;
82 
84  private int nextRecordListID = 0;
85 
93  int numRecords = 0;
94 
104  public void read(DataInput in) throws IOException {
105  pdbName = new byte[PalmDB.NAME_LENGTH];
106  in.readFully(pdbName);
107  attribute = in.readShort();
108  version = in.readUnsignedShort();
109  creationDate = in.readInt() & 0xffffffffL;
110  modificationDate = in.readInt() & 0xffffffffL;
111  lastBackupDate = in.readInt() & 0xffffffffL;
112  modificationNumber = in.readInt() & 0xffffffffL;
113  appInfoID = in.readInt();
114  sortInfoID = in.readInt();
115  creatorID = in.readInt();
116  typeID = in.readInt();
117  uniqueIDSeed = in.readInt();
118  nextRecordListID = in.readInt();
119  numRecords = in.readUnsignedShort();
120  }
121 
129  public void write(DataOutput out) throws IOException {
130  out.write(pdbName);
131  out.writeShort(attribute);
132  out.writeShort(version);
133  out.writeInt((int) creationDate);
134  out.writeInt((int) modificationDate);
135  out.writeInt((int) lastBackupDate);
136  out.writeInt((int) modificationNumber);
137  out.writeInt(appInfoID);
138  out.writeInt(sortInfoID);
139  out.writeInt(typeID);
140  out.writeInt(creatorID);
141  out.writeInt(uniqueIDSeed);
142  out.writeInt(nextRecordListID);
143  out.writeShort(numRecords);
144  }
145 }
exports com.sun.star. java
sal_Int32 attribute
unsigned char byte
CFUUIDRef typeID(void) allocator