|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.RandomAccessFile | +--com.slurm.gf.GFFile
Utility class for reading data out of a binary file that represents a generic font.
This class extends RandomAccessFile so that it can easily extract the information in the "postamble", which (naturally enough) occurs at the end.
Constructor Summary | |
GFFile(java.lang.String s)
Creates a GF file stream to read from the file with the specified name. |
Method Summary | |
boolean |
eof()
Tests for end of file. |
PostCommand |
getPostCommand()
Reads the (hopefully unique) Post command in this file. |
int |
readByteAsInt()
Reads a single byte from the file and returns it as an int. |
Command |
readCommand()
Reads a GF opcode and its associated parameters. |
int |
readFourBytesAsInt()
Reads four bytes from the file and interprets them as an int. |
int |
readThreeBytesAsInt()
Reads three bytes from the file and interprets them as an int. |
int |
readTwoBytesAsInt()
Reads two bytes from the file and interprets them as an int. |
Methods inherited from class java.io.RandomAccessFile |
close,
getFD,
getFilePointer,
length,
read,
read,
read,
readBoolean,
readByte,
readChar,
readDouble,
readFloat,
readFully,
readFully,
readInt,
readLine,
readLong,
readShort,
readUnsignedByte,
readUnsignedShort,
readUTF,
seek,
setLength,
skipBytes,
write,
write,
write,
writeBoolean,
writeByte,
writeBytes,
writeChar,
writeChars,
writeDouble,
writeFloat,
writeInt,
writeLong,
writeShort,
writeUTF |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public GFFile(java.lang.String s) throws java.io.FileNotFoundException
s
- the name of the fileMethod Detail |
public boolean eof()
public int readByteAsInt()
public int readTwoBytesAsInt()
public int readThreeBytesAsInt()
public int readFourBytesAsInt()
public Command readCommand() throws GFFileFormatException
Command
public PostCommand getPostCommand() throws GFFileFormatException
The method used is suggested in (module 19 of) the original gftype program:
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |