Top Inners Fields Constructors Methods
com.sun.javafx.font

pack-priv Class FontFileReader

extends Object
implements FontConstants
Class Inheritance
All Implemented Interfaces
com.sun.javafx.font.FontConstants
Imports
java.io.FileNotFoundException, .IOException, .RandomAccessFile

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv String
pack-priv long
pack-priv RandomAccessFile
private byte[]
private int
private static final int
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public synchronized void
public String
public synchronized long
public synchronized boolean

Returns:

returns true if the file opened, false if the file was opened already or if it failed to open the file.
openFile
()

Opens the file.

public synchronized FontFileReader.Buffer
readBlock(int offset, int len)

private synchronized int

Returns:

0 if there was a problem, else number of bytes read.
readFromFile
(byte[] buffer, long seekPos, int requestedLen)

Called internally to readBlock().

public synchronized void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

filenameback to summary
pack-priv String filename
filesizeback to summary
pack-priv long filesize
raFileback to summary
pack-priv RandomAccessFile raFile
readBufferback to summary
private byte[] readBuffer
readBufferLenback to summary
private int readBufferLen
READBUFFERSIZEback to summary
private static final int READBUFFERSIZE
readBufferStartback to summary
private int readBufferStart

Constructor Detail

FontFileReaderback to summary
public FontFileReader(String filename)

Method Detail

closeFileback to summary
public synchronized void closeFile() throws IOException
getFilenameback to summary
public String getFilename()
getLengthback to summary
public synchronized long getLength()
openFileback to summary
public synchronized boolean openFile()

Opens the file.

Returns:boolean

returns true if the file opened, false if the file was opened already or if it failed to open the file.

readBlockback to summary
public synchronized FontFileReader.Buffer readBlock(int offset, int len)
readFromFileback to summary
private synchronized int readFromFile(byte[] buffer, long seekPos, int requestedLen)

Called internally to readBlock(). Don't use directly. Caller must ensure dataLen < buffer length This method will sanity check that you aren't reading past the end of the file.

Returns:int

0 if there was a problem, else number of bytes read.

resetback to summary
public synchronized void reset() throws IOException
com.sun.javafx.font back to summary

pack-priv Class FontFileReader.Buffer

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv byte[]
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
Buffer(byte[]
the buffer
data
,
int
the starting position within the data array. pos is considered to be the start of this Buffer object. There is no protection against reading past the end, caller is assumed to be careful.
bufStart
)

Method Summary

Modifier and TypeMethod and Description
pack-priv int
pack-priv byte
get()

pack-priv byte
get(int tpos)

pack-priv void
get(int startPos, byte[] dest, int destPos, int destLen)

pack-priv char
getChar(int tpos)

pack-priv char
pack-priv int
getInt(int tpos)

pack-priv int
pack-priv short
getShort(int tpos)

pack-priv short
pack-priv void
position(int newPos)

pack-priv void
skip(int nbytes)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
pack-priv byte[] data
origback to summary
pack-priv int orig
posback to summary
pack-priv int pos

Constructor Detail

Bufferback to summary
pack-priv Buffer(byte[] data, int bufStart)
Parameters
data:byte[]

the buffer

bufStart:int

the starting position within the data array. pos is considered to be the start of this Buffer object. There is no protection against reading past the end, caller is assumed to be careful.

Method Detail

capacityback to summary
pack-priv int capacity()
getback to summary
pack-priv byte get()
getback to summary
pack-priv byte get(int tpos)
getback to summary
pack-priv void get(int startPos, byte[] dest, int destPos, int destLen)
getCharback to summary
pack-priv char getChar(int tpos)
getCharback to summary
pack-priv char getChar()
getIntback to summary
pack-priv int getInt(int tpos)
getIntback to summary
pack-priv int getInt()
getShortback to summary
pack-priv short getShort(int tpos)
getShortback to summary
pack-priv short getShort()
positionback to summary
pack-priv void position(int newPos)
skipback to summary
pack-priv void skip(int nbytes)