org.fontbox.ttf

Class MemoryTTFDataStream


public class MemoryTTFDataStream
extends TTFDataStream

An interface into a data stream.
Version:
$Revision: 1.2 $
Author:
Ben Litchfield (ben@benlitchfield.com)

Constructor Summary

MemoryTTFDataStream(InputStream is)
Constructor from a stream.

Method Summary

void
close()
Close the underlying resources.
long
getCurrentPosition()
Get the current position in the stream.
InputStream
getOriginalData()
int
read()
Read an unsigned byte.
int
read(byte[] b, int off, int len)
long
readLong()
Read an unsigned byte.
int
readSignedInt()
Read a signed integer.
short
readSignedShort()
Read an signed short.
int
readUnsignedShort()
Read an unsigned short.
void
seek(long pos)
Seek into the datasource.

Methods inherited from class org.fontbox.ttf.TTFDataStream

close, getCurrentPosition, getOriginalData, read, read, read, read32Fixed, readInternationalDate, readLong, readSignedByte, readSignedShort, readString, readString, readUnsignedInt, readUnsignedShort, readUnsignedShortArray, seek

Constructor Details

MemoryTTFDataStream

public MemoryTTFDataStream(InputStream is)
            throws IOException
Constructor from a stream.
Parameters:
is - The stream of read from.

Method Details

close

public void close()
            throws IOException
Close the underlying resources.
Overrides:
close in interface TTFDataStream

getCurrentPosition

public long getCurrentPosition()
            throws IOException
Get the current position in the stream.
Overrides:
getCurrentPosition in interface TTFDataStream
Returns:
The current position in the stream.

getOriginalData

public InputStream getOriginalData()
            throws IOException
Overrides:
getOriginalData in interface TTFDataStream

read

public int read()
            throws IOException
Read an unsigned byte.
Overrides:
read in interface TTFDataStream
Returns:
An unsigned byte.

read

public int read(byte[] b,
                int off,
                int len)
            throws IOException
Overrides:
read in interface TTFDataStream
Parameters:
b - The buffer to write to.
off - The offset into the buffer.
len - The length into the buffer.
Returns:
The number of bytes read.
See Also:
java.io.InputStream.read( byte[], int, int )

readLong

public long readLong()
            throws IOException
Read an unsigned byte.
Overrides:
readLong in interface TTFDataStream
Returns:
An unsigned byte.

readSignedInt

public int readSignedInt()
            throws IOException
Read a signed integer.
Returns:
A signed integer.

readSignedShort

public short readSignedShort()
            throws IOException
Read an signed short.
Overrides:
readSignedShort in interface TTFDataStream
Returns:
An signed short.

readUnsignedShort

public int readUnsignedShort()
            throws IOException
Read an unsigned short.
Overrides:
readUnsignedShort in interface TTFDataStream
Returns:
An unsigned short.

seek

public void seek(long pos)
            throws IOException
Seek into the datasource.
Overrides:
seek in interface TTFDataStream
Parameters:
pos - The position to seek to.