public abstract class TTFDataStream
extends java.lang.Object
| Constructor and Description |
|---|
TTFDataStream() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Close the underlying resources.
|
abstract long |
getCurrentPosition()
Get the current position in the stream.
|
abstract java.io.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.
|
java.util.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.
|
java.lang.String |
readString(int length)
Read a fixed length ascii string.
|
java.lang.String |
readString(int length,
java.lang.String charset)
Read a fixed length ascii string.
|
int |
readUnsignedByte()
Read a unsigned byte.
|
int[] |
readUnsignedByteArray(int length)
Read an unsigned byte array.
|
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.
|
public float read32Fixed()
throws java.io.IOException
java.io.IOException - If there is an error reading the data.public java.lang.String readString(int length)
throws java.io.IOException
length - The length of the string to read.java.io.IOException - If there is an error reading the data.public java.lang.String readString(int length,
java.lang.String charset)
throws java.io.IOException
length - The length of the string to read in bytes.charset - The expected character set of the string.java.io.IOException - If there is an error reading the data.public abstract int read()
throws java.io.IOException
java.io.IOException - If there is an error reading the data.public abstract long readLong()
throws java.io.IOException
java.io.IOException - If there is an error reading the data.public int readSignedByte()
throws java.io.IOException
java.io.IOException - If there is an error reading the data.public int readUnsignedByte()
throws java.io.IOException
read(), but throws an exception if EOF is unexpectedly reached.java.io.IOException - If there is an error reading the data.public long readUnsignedInt()
throws java.io.IOException
java.io.IOException - If there is an error reading the data.public abstract int readUnsignedShort()
throws java.io.IOException
java.io.IOException - If there is an error reading the data.public int[] readUnsignedByteArray(int length)
throws java.io.IOException
length - the length of the array to be readjava.io.IOException - If there is an error reading the data.public int[] readUnsignedShortArray(int length)
throws java.io.IOException
length - The length of the array to read.java.io.IOException - If there is an error reading the data.public abstract short readSignedShort()
throws java.io.IOException
java.io.IOException - If there is an error reading the data.public java.util.Calendar readInternationalDate()
throws java.io.IOException
java.io.IOException - If there is an error reading the data.public abstract void close()
throws java.io.IOException
java.io.IOException - If there is an error closing the resources.public abstract void seek(long pos)
throws java.io.IOException
pos - The position to seek to.java.io.IOException - If there is an error seeking to that position.public byte[] read(int numberOfBytes)
throws java.io.IOException
numberOfBytes - The number of bytes to read.java.io.IOException - If there is an error while reading.public abstract int read(byte[] b,
int off,
int len)
throws java.io.IOException
b - The buffer to write to.off - The offset into the buffer.len - The length into the buffer.java.io.IOException - If there is an error reading from the stream.InputStream.read(byte[], int, int )public abstract long getCurrentPosition()
throws java.io.IOException
java.io.IOException - If an error occurs while reading the stream.public abstract java.io.InputStream getOriginalData()
throws java.io.IOException
java.io.IOException - If there is an issue reading the data.