public class FontFileReader
extends java.lang.Object
| Constructor and Description |
|---|
FontFileReader(java.io.InputStream in)
Constructor
|
FontFileReader(java.lang.String path)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getAllBytes()
Returns the full byte array representation of the file.
|
int |
getCurrentPos()
Returns current file position.
|
int |
getFileSize()
Returns the size of the file.
|
byte |
readTTFByte()
Read 1 signed byte.
|
int |
readTTFLong()
Read 4 bytes.
|
java.lang.String |
readTTFString(int len)
Read an ISO-8859-1 string of len bytes.
|
java.lang.String |
readTTFString(int len,
int encodingID)
Read an ISO-8859-1 string of len bytes.
|
int |
readTTFUByte()
Read 1 unsigned byte.
|
long |
readTTFULong()
Read 4 bytes.
|
int |
readTTFUShort()
Read 2 bytes unsigned.
|
void |
seekSet(long offset)
Set current file position to offset
|
void |
skip(long add)
Skip a given number of bytes.
|
public FontFileReader(java.io.InputStream in)
throws java.io.IOException
in - InputStream to read fromjava.io.IOException - In case of an I/O problempublic FontFileReader(java.lang.String path)
throws java.io.IOException
path - file to readjava.io.IOException - In case of an I/O problempublic byte[] getAllBytes()
public int getCurrentPos()
public int getFileSize()
public byte readTTFByte()
throws java.io.IOException
java.io.IOException - If EOF is reachedpublic int readTTFLong()
throws java.io.IOException
java.io.IOException - If EOF is reachedpublic java.lang.String readTTFString(int len)
throws java.io.IOException
len - The length of the string to readjava.io.IOException - If EOF is reachedpublic java.lang.String readTTFString(int len,
int encodingID)
throws java.io.IOException
len - The length of the string to readencodingID - the string encoding id (presently ignored; always uses UTF-16BE)java.io.IOException - If EOF is reachedpublic int readTTFUByte()
throws java.io.IOException
java.io.IOException - If EOF is reachedpublic long readTTFULong()
throws java.io.IOException
java.io.IOException - If EOF is reachedpublic int readTTFUShort()
throws java.io.IOException
java.io.IOException - If EOF is reachedpublic void seekSet(long offset)
throws java.io.IOException
offset - The new offset to setjava.io.IOException - In case of an I/O problempublic void skip(long add)
throws java.io.IOException
add - The number of bytes to advancejava.io.IOException - In case of an I/O problem