org.apache.fontbox.cff

## Class CFFDataInput

- java.lang.Object
- - org.apache.fontbox.cff.DataInput
  - - org.apache.fontbox.cff.CFFDataInput

    public class CFFDataInput
    extends DataInput

This is specialized DataInput. It's used to parse a CFFFont.

Author:
  Villu Ruusmann

### Constructor Summary

Constructors
Constructor and Description
`CFFDataInput(byte[] buffer)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `readCard16()` Read one single Card16 value from the buffer.
`int` `readCard8()` Read one single Card8 value from the buffer.
`int` `readOffset(int offSize)` Read the offset from the buffer.
`int` `readOffSize()` Read offSize from the buffer.
`int` `readSID()` Read a SID from the buffer.

### Methods inherited from class org.apache.fontbox.cff.DataInput

`getPosition, getString, hasRemaining, length, peekUnsignedByte, readByte, readBytes, readInt, readShort, readUnsignedByte, readUnsignedShort, setPosition`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CFFDataInput

    public CFFDataInput(byte[] buffer)

Constructor.

Parameters:
  `buffer` - the buffer to be read

### Method Detail

#### readCard8

    public int readCard8()
                  throws IOException

Read one single Card8 value from the buffer.

Returns:
  the card8 value
Throws:
  `IOException` - if an error occurs during reading

#### readCard16

    public int readCard16()
                   throws IOException

Read one single Card16 value from the buffer.

Returns:
  the card16 value
Throws:
  `IOException` - if an error occurs during reading

#### readOffset

    public int readOffset(int offSize)
                   throws IOException

Read the offset from the buffer.

Parameters:
  `offSize` - the given offsize
Returns:
  the offset
Throws:
  `IOException` - if an error occurs during reading

#### readOffSize

    public int readOffSize()
                    throws IOException

Read offSize from the buffer. This is a 1 byte value between 1 and 4.

Returns:
  the offSize.
Throws:
  `IOException` - if an error occurs during reading or if the value is illegal.

#### readSID

    public int readSID()
                throws IOException

Read a SID from the buffer.

Returns:
  the SID
Throws:
  `IOException` - if an error occurs during reading