Top Description Methods
org.apache.fontbox.cff

public Interface DataInput

Known Direct Implementers
org.apache.fontbox.cff.DataInputByteArray, org.apache.fontbox.cff.DataInputRandomAccessRead
Imports
java.io.IOException

This interface defines some functionality to read a CFF font.
Author
Villu Ruusmann

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

current position
getPosition
()

Returns the current position.

public boolean

Returns:

true if there are any bytes left to read
hasRemaining
()

Determines if there are any bytes left to read or not.

public int
public int

Returns:

the unsigned byte as int
peekUnsignedByte
(int
offset to the byte to be peeked
offset
)

Peeks one single unsigned byte from the buffer.

public byte

Returns:

the byte
readByte
()

Read one single byte from the buffer.

public byte[]

Returns:

an array with containing the bytes from the buffer
readBytes
(int
the number of bytes to be read
length
)

Read a number of single byte values from the buffer.

public default int

Returns:

the int value
readInt
()

Read one single int (4 bytes) from the buffer.

public default int

Returns:

the offset
readOffset
(int
the given offsize
offSize
)

Read the offset from the buffer.

public default short

Returns:

the short value
readShort
()

Read one single short value from the buffer.

public int

Returns:

the unsigned byte as int
readUnsignedByte
()

Read one single unsigned byte from the buffer.

public default int

Returns:

the unsigned short value as int
readUnsignedShort
()

Read one single unsigned short (2 bytes) value from the buffer.

public void
setPosition(int
the given position
position
)

Sets the current position to the given value.

Method Detail

getPositionback to summary
public int getPosition() throws IOException

Returns the current position.

Returns:int

current position

Exceptions
IOException:
if an error occurs during reading
hasRemainingback to summary
public boolean hasRemaining() throws IOException

Determines if there are any bytes left to read or not.

Returns:boolean

true if there are any bytes left to read

Exceptions
IOException:
if an error occurs during reading
lengthback to summary
public int length() throws IOException
peekUnsignedByteback to summary
public int peekUnsignedByte(int offset) throws IOException

Peeks one single unsigned byte from the buffer.

Parameters
offset:int

offset to the byte to be peeked

Returns:int

the unsigned byte as int

Exceptions
IOException:
if an error occurs during reading
readByteback to summary
public byte readByte() throws IOException

Read one single byte from the buffer.

Returns:byte

the byte

Exceptions
IOException:
if an error occurs during reading
readBytesback to summary
public byte[] readBytes(int length) throws IOException

Read a number of single byte values from the buffer.

Parameters
length:int

the number of bytes to be read

Returns:byte[]

an array with containing the bytes from the buffer

Exceptions
IOException:
if an error occurs during reading
readIntback to summary
public default int readInt() throws IOException

Read one single int (4 bytes) from the buffer.

Returns:int

the int value

Exceptions
IOException:
if an error occurs during reading
readOffsetback to summary
public default int readOffset(int offSize) throws IOException

Read the offset from the buffer.

Parameters
offSize:int

the given offsize

Returns:int

the offset

Exceptions
IOException:
if an error occurs during reading
readShortback to summary
public default short readShort() throws IOException

Read one single short value from the buffer.

Returns:short

the short value

Exceptions
IOException:
if an error occurs during reading
readUnsignedByteback to summary
public int readUnsignedByte() throws IOException

Read one single unsigned byte from the buffer.

Returns:int

the unsigned byte as int

Exceptions
IOException:
if an error occurs during reading
readUnsignedShortback to summary
public default int readUnsignedShort() throws IOException

Read one single unsigned short (2 bytes) value from the buffer.

Returns:int

the unsigned short value as int

Exceptions
IOException:
if an error occurs during reading
setPositionback to summary
public void setPosition(int position) throws IOException

Sets the current position to the given value.

Parameters
position:int

the given position

Exceptions
IOException:
if the new position ist out of range