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

public Class DataInputByteArray

extends Object
implements DataInput
Class Inheritance
All Implemented Interfaces
org.apache.fontbox.cff.DataInput
Imports
java.io.IOException

This class implements the DataInput interface using a byte buffer as source.
Author
Villu Ruusmann

Field Summary

Modifier and TypeField and Description
private int
private final byte[]

Constructor Summary

AccessConstructor and Description
public
DataInputByteArray(byte[]
the buffer to be read
buffer
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

current position
getPosition
()

Implements org.apache.fontbox.cff.DataInput.getPosition.

Returns the current position.

public boolean

Returns:

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

Implements org.apache.fontbox.cff.DataInput.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
)

Implements org.apache.fontbox.cff.DataInput.peekUnsignedByte.

Peeks one single unsigned byte from the buffer.

public byte

Returns:

the byte
readByte
()

Implements org.apache.fontbox.cff.DataInput.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
)

Implements org.apache.fontbox.cff.DataInput.readBytes.

Read a number of single byte values from the buffer.

public int

Returns:

the unsigned byte as int
readUnsignedByte
()

Implements org.apache.fontbox.cff.DataInput.readUnsignedByte.

Read one single unsigned byte from the buffer.

public void
setPosition(int
the given position
position
)

Implements org.apache.fontbox.cff.DataInput.setPosition.

Sets the current position to the given value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferPositionback to summary
private int bufferPosition
inputBufferback to summary
private final byte[] inputBuffer

Constructor Detail

DataInputByteArrayback to summary
public DataInputByteArray(byte[] buffer)

Constructor.

Parameters
buffer:byte[]

the buffer to be read

Method Detail

getPositionback to summary
public int getPosition()

Implements org.apache.fontbox.cff.DataInput.getPosition.

Returns the current position.

Returns:int

current position

Annotations
@Override
hasRemainingback to summary
public boolean hasRemaining() throws IOException

Implements org.apache.fontbox.cff.DataInput.hasRemaining.

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

Returns:boolean

true if there are any bytes left to read

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.fontbox.cff.DataInput.hasRemaining.

if an error occurs during reading

lengthback to summary
public int length() throws IOException

Implements org.apache.fontbox.cff.DataInput.length.

Annotations
@Override
peekUnsignedByteback to summary
public int peekUnsignedByte(int offset) throws IOException

Implements org.apache.fontbox.cff.DataInput.peekUnsignedByte.

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

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

Implements org.apache.fontbox.cff.DataInput.readByte.

Read one single byte from the buffer.

Returns:byte

the byte

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

Implements org.apache.fontbox.cff.DataInput.readBytes.

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

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

Implements org.apache.fontbox.cff.DataInput.readUnsignedByte.

Read one single unsigned byte from the buffer.

Returns:int

the unsigned byte as int

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

Implements org.apache.fontbox.cff.DataInput.setPosition.

Sets the current position to the given value.

Parameters
position:int

the given position

Annotations
@Override
Exceptions
IOException:
if the new position ist out of range