Top Description Fields Constructors Methods
org.apache.fontbox.ttf

pack-priv Class TTCDataStream

extends TTFDataStream
Class Inheritance
Imports
java.io.IOException, .InputStream, org.apache.pdfbox.io.RandomAccessRead

A wrapper for a TTF stream inside a TTC file, does not close the underlying shared stream.
Author
John Hewson

Field Summary

Modifier and TypeField and Description
private final TTFDataStream

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

public RandomAccessRead
createSubView(long length)

Overrides org.apache.fontbox.ttf.TTFDataStream.createSubView.

Creates a view from current position to pos + length.

public long
getCurrentPosition()

Implements abstract org.apache.fontbox.ttf.TTFDataStream.getCurrentPosition.

Get the current position in the stream.

public InputStream
getOriginalData()

Implements abstract org.apache.fontbox.ttf.TTFDataStream.getOriginalData.

This will get the original data file that was used for this stream.

public long
getOriginalDataSize()

Implements abstract org.apache.fontbox.ttf.TTFDataStream.getOriginalDataSize.

This will get the original data size that was used for this stream.

public int
read()

Implements abstract org.apache.fontbox.ttf.TTFDataStream.read.

Read an unsigned byte.

public int
read(byte[]
The buffer to write to.
b
,
int
The offset into the buffer.
off
,
int
The length into the buffer.
len
)

Implements abstract org.apache.fontbox.ttf.TTFDataStream.read.

public long
readLong()

Implements abstract org.apache.fontbox.ttf.TTFDataStream.readLong.

Read an unsigned byte.

public void
seek(long
The position to seek to.
pos
)

Implements abstract org.apache.fontbox.ttf.TTFDataStream.seek.

Seek into the datasource.

Inherited from org.apache.fontbox.ttf.TTFDataStream:
readread32FixedreadInternationalDatereadSignedBytereadSignedShortreadStringreadStringreadTagreadUnsignedBytereadUnsignedByteArrayreadUnsignedIntreadUnsignedShortreadUnsignedShortArray

Field Detail

streamback to summary
private final TTFDataStream stream

Constructor Detail

TTCDataStreamback to summary
pack-priv TTCDataStream(TTFDataStream stream)

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
createSubViewback to summary
public RandomAccessRead createSubView(long length)

Overrides org.apache.fontbox.ttf.TTFDataStream.createSubView.

Doc from org.apache.fontbox.ttf.TTFDataStream.createSubView.

Creates a view from current position to pos + length. It can be faster than read(length) if you only need a few bytes. SubView.close() should never close TTFDataStream.this, only itself.

Returns:RandomAccessRead

A view or null (caller can use read instead). Please close() the result

Annotations
@Override
getCurrentPositionback to summary
public long getCurrentPosition() throws IOException

Implements abstract org.apache.fontbox.ttf.TTFDataStream.getCurrentPosition.

Doc from org.apache.fontbox.ttf.TTFDataStream.getCurrentPosition.

Get the current position in the stream.

Returns:long

The current position in the stream.

Annotations
@Override
Exceptions
IOException:
If an error occurs while reading the stream.
getOriginalDataback to summary
public InputStream getOriginalData() throws IOException

Implements abstract org.apache.fontbox.ttf.TTFDataStream.getOriginalData.

Doc from org.apache.fontbox.ttf.TTFDataStream.getOriginalData.

This will get the original data file that was used for this stream.

Returns:InputStream

The data that was read from.

Annotations
@Override
Exceptions
IOException:
If there is an issue reading the data.
getOriginalDataSizeback to summary
public long getOriginalDataSize()

Implements abstract org.apache.fontbox.ttf.TTFDataStream.getOriginalDataSize.

Doc from org.apache.fontbox.ttf.TTFDataStream.getOriginalDataSize.

This will get the original data size that was used for this stream.

Returns:long

The size of the original data.

Annotations
@Override
readback to summary
public int read() throws IOException

Implements abstract org.apache.fontbox.ttf.TTFDataStream.read.

Doc from org.apache.fontbox.ttf.TTFDataStream.read.

Read an unsigned byte.

Returns:int

An unsigned byte.

Annotations
@Override
Exceptions
IOException:
If there is an error reading the data.
readback to summary
public int read(byte[] b, int off, int len) throws IOException

Implements abstract org.apache.fontbox.ttf.TTFDataStream.read.

Parameters
b:byte[]

Doc from org.apache.fontbox.ttf.TTFDataStream.read.

The buffer to write to.

off:int

Doc from org.apache.fontbox.ttf.TTFDataStream.read.

The offset into the buffer.

len:int

Doc from org.apache.fontbox.ttf.TTFDataStream.read.

The length into the buffer.

Returns:int

Doc from org.apache.fontbox.ttf.TTFDataStream.read.

The number of bytes read, or -1 at the end of the stream

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.fontbox.ttf.TTFDataStream.read.

If there is an error reading from the stream.

readLongback to summary
public long readLong() throws IOException

Implements abstract org.apache.fontbox.ttf.TTFDataStream.readLong.

Doc from org.apache.fontbox.ttf.TTFDataStream.readLong.

Read an unsigned byte.

Returns:long

An unsigned byte.

Annotations
@Override
Exceptions
IOException:
If there is an error reading the data.
seekback to summary
public void seek(long pos) throws IOException

Implements abstract org.apache.fontbox.ttf.TTFDataStream.seek.

Doc from org.apache.fontbox.ttf.TTFDataStream.seek.

Seek into the datasource.

Parameters
pos:long

The position to seek to.

Annotations
@Override
Exceptions
IOException:
If there is an error seeking to that position.