org.fontbox.ttf
Class TTFDataStream
java.lang.Object
org.fontbox.ttf.TTFDataStream
public abstract class TTFDataStream
extends java.lang.Object
An interface into a data stream.
- Ben Litchfield (ben@benlitchfield.com)
abstract void | close() - Close the underlying resources.
|
abstract long | getCurrentPosition() - Get the current position in the stream.
|
abstract InputStream | getOriginalData() - This will get the original data file that was used for this
stream.
|
abstract int | read() - Read an unsigned byte.
|
abstract int | read(byte[] b, int off, int len)
|
byte[] | read(int numberOfBytes) - Read a specific number of bytes from the stream.
|
float | read32Fixed() - Read a 16.16 fixed value, where the first 16 bits are the decimal and the last
16 bits are the fraction.
|
Calendar | readInternationalDate() - Read an eight byte international date.
|
abstract long | readLong() - Read an unsigned byte.
|
int | readSignedByte() - Read a signed byte.
|
abstract short | readSignedShort() - Read an signed short.
|
String | readString(int length) - Read a fixed length ascii string.
|
String | readString(int length, String charset) - Read a fixed length ascii string.
|
long | readUnsignedInt() - Read an unsigned integer.
|
abstract int | readUnsignedShort() - Read an unsigned short.
|
int[] | readUnsignedShortArray(int length) - Read an unsigned short array.
|
abstract void | seek(long pos) - Seek into the datasource.
|
close
public abstract void close()
throws IOException
Close the underlying resources.
getCurrentPosition
public abstract long getCurrentPosition()
throws IOException
Get the current position in the stream.
- The current position in the stream.
getOriginalData
public abstract InputStream getOriginalData()
throws IOException
This will get the original data file that was used for this
stream.
- The data that was read from.
read
public abstract int read()
throws IOException
Read an unsigned byte.
read
public abstract int read(byte[] b,
int off,
int len)
throws IOException
b
- The buffer to write to.off
- The offset into the buffer.len
- The length into the buffer.
- The number of bytes read.
java.io.InputStream.read( byte[], int, int )
read
public byte[] read(int numberOfBytes)
throws IOException
Read a specific number of bytes from the stream.
numberOfBytes
- The number of bytes to read.
read32Fixed
public float read32Fixed()
throws IOException
Read a 16.16 fixed value, where the first 16 bits are the decimal and the last
16 bits are the fraction.
readInternationalDate
public Calendar readInternationalDate()
throws IOException
Read an eight byte international date.
readLong
public abstract long readLong()
throws IOException
Read an unsigned byte.
readSignedByte
public int readSignedByte()
throws IOException
Read a signed byte.
readSignedShort
public abstract short readSignedShort()
throws IOException
Read an signed short.
readString
public String readString(int length)
throws IOException
Read a fixed length ascii string.
length
- The length of the string to read.
- A string of the desired length.
readString
public String readString(int length,
String charset)
throws IOException
Read a fixed length ascii string.
length
- The length of the string to read in bytes.charset
- The expected character set of the string.
- A string of the desired length.
readUnsignedInt
public long readUnsignedInt()
throws IOException
Read an unsigned integer.
readUnsignedShort
public abstract int readUnsignedShort()
throws IOException
Read an unsigned short.
readUnsignedShortArray
public int[] readUnsignedShortArray(int length)
throws IOException
Read an unsigned short array.
length
- The length of the array to read.
seek
public abstract void seek(long pos)
throws IOException
Seek into the datasource.
pos
- The position to seek to.