1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-06 03:50:19 +02:00

plucker support (in progress)

git-svn-id: https://only.mawhrin.net/repos/FBReaderJ/trunk@829 6a642e6f-84f6-412e-ac94-c4a38d5a04b0
This commit is contained in:
Nikolay Pultsin 2008-04-15 01:47:55 +00:00
parent 69fb2d8d0b
commit ba4ca95cda
11 changed files with 261 additions and 144 deletions

View file

@ -32,29 +32,34 @@ public class PdbHeader {
public boolean read(InputStream stream) throws IOException {
final byte[] buffer = new byte[32];
if (stream.read(buffer, 0, 32) != 32) {
System.err.println("way 0");
return false;
}
DocName = new String(buffer);
Flags = PdbUtil.readUnsignedShort(stream);
Flags = PdbUtil.readShort(stream);
stream.skip(26);
if (stream.read(buffer, 0, 8) != 8) {
System.err.println("way 1");
return false;
}
Id = new String(buffer, 0, 8);
stream.skip(8);
int numRecords = PdbUtil.readUnsignedShort(stream);
int numRecords = PdbUtil.readShort(stream);
if (numRecords <= 0) {
System.err.println(numRecords);
System.err.println("way 2");
return false;
}
Offsets = new int[numRecords];
for (int i = 0; i < numRecords; ++i) {
Offsets[i] = stream.read();
Offsets[i] = PdbUtil.readInt(stream);
if (stream.skip(4) != 4) {
System.err.println("way 3");
return false;
}
}