Package org.apache.fontbox.cff
Class DataInputByteArray
- java.lang.Object
-
- org.apache.fontbox.cff.DataInputByteArray
-
-
Field Summary
Fields Modifier and Type Field Description private intbufferPositionprivate byte[]inputBuffer
-
Constructor Summary
Constructors Constructor Description DataInputByteArray(byte[] buffer)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetPosition()Returns the current position.booleanhasRemaining()Determines if there are any bytes left to read or not.intlength()intpeekUnsignedByte(int offset)Peeks one single unsigned byte from the buffer.bytereadByte()Read one single byte from the buffer.byte[]readBytes(int length)Read a number of single byte values from the buffer.intreadUnsignedByte()Read one single unsigned byte from the buffer.voidsetPosition(int position)Sets the current position to the given value.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.fontbox.cff.DataInput
readInt, readOffset, readShort, readUnsignedShort
-
-
-
-
Method Detail
-
hasRemaining
public boolean hasRemaining() throws java.io.IOExceptionDetermines if there are any bytes left to read or not.- Specified by:
hasRemainingin interfaceDataInput- Returns:
- true if there are any bytes left to read
- Throws:
java.io.IOException- if an error occurs during reading
-
getPosition
public int getPosition()
Returns the current position.- Specified by:
getPositionin interfaceDataInput- Returns:
- current position
-
setPosition
public void setPosition(int position) throws java.io.IOExceptionSets the current position to the given value.- Specified by:
setPositionin interfaceDataInput- Parameters:
position- the given position- Throws:
java.io.IOException- if the new position ist out of range
-
readByte
public byte readByte() throws java.io.IOExceptionRead one single byte from the buffer.
-
readUnsignedByte
public int readUnsignedByte() throws java.io.IOExceptionRead one single unsigned byte from the buffer.- Specified by:
readUnsignedBytein interfaceDataInput- Returns:
- the unsigned byte as int
- Throws:
java.io.IOException- if an error occurs during reading
-
peekUnsignedByte
public int peekUnsignedByte(int offset) throws java.io.IOExceptionPeeks one single unsigned byte from the buffer.- Specified by:
peekUnsignedBytein interfaceDataInput- Parameters:
offset- offset to the byte to be peeked- Returns:
- the unsigned byte as int
- Throws:
java.io.IOException- if an error occurs during reading
-
readBytes
public byte[] readBytes(int length) throws java.io.IOExceptionRead a number of single byte values from the buffer.
-
-