Package org.apache.fontbox.pfb
Class PfbParser
java.lang.Object
org.apache.fontbox.pfb.PfbParser
Parser for a pfb-file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
the ascii marker.private static final int
the binary marker.private static final int
buffersize.private int[]
the lengths of the records.private static final int
the pfb header length.private static final int[]
The record types in the pfb-file.private byte[]
the parsed pfb-data.private static final int
the start marker. -
Constructor Summary
ConstructorsConstructorDescriptionPfbParser
(byte[] bytes) Create a new object.PfbParser
(InputStream in) Create a new object.Create a new object. -
Method Summary
Modifier and TypeMethodDescriptionReturns the pfb data as stream.int[]
Returns the lengths.byte[]
Returns the pfbdata.byte[]
Returns the first segmentbyte[]
Returns the second segmentprivate void
parsePfb
(byte[] pfb) Parse the pfb-array.private byte[]
readFully
(InputStream in) Read the pfb input.int
size()
Returns the size of the pfb-data.
-
Field Details
-
PFB_HEADER_LENGTH
private static final int PFB_HEADER_LENGTHthe pfb header length. (start-marker (1 byte), ascii-/binary-marker (1 byte), size (4 byte)) 3*6 == 18- See Also:
-
START_MARKER
private static final int START_MARKERthe start marker.- See Also:
-
ASCII_MARKER
private static final int ASCII_MARKERthe ascii marker.- See Also:
-
BINARY_MARKER
private static final int BINARY_MARKERthe binary marker.- See Also:
-
PFB_RECORDS
private static final int[] PFB_RECORDSThe record types in the pfb-file. -
BUFFER_SIZE
private static final int BUFFER_SIZEbuffersize.- See Also:
-
pfbdata
private byte[] pfbdatathe parsed pfb-data. -
lengths
private int[] lengthsthe lengths of the records.
-
-
Constructor Details
-
PfbParser
Create a new object.- Parameters:
filename
- the file name- Throws:
IOException
- if an IO-error occurs.
-
PfbParser
Create a new object.- Parameters:
in
- The input.- Throws:
IOException
- if an IO-error occurs.
-
PfbParser
Create a new object.- Parameters:
bytes
- The input.- Throws:
IOException
- if an IO-error occurs.
-
-
Method Details
-
parsePfb
Parse the pfb-array.- Parameters:
pfb
- The pfb-Array- Throws:
IOException
- in an IO-error occurs.
-
readFully
Read the pfb input.- Parameters:
in
- The input.- Returns:
- Returns the pfb-array.
- Throws:
IOException
- if an IO-error occurs.
-
getLengths
public int[] getLengths()Returns the lengths.- Returns:
- Returns the lengths.
-
getPfbdata
public byte[] getPfbdata()Returns the pfbdata.- Returns:
- Returns the pfbdata.
-
getInputStream
Returns the pfb data as stream.- Returns:
- Returns the pfb data as stream.
-
size
public int size()Returns the size of the pfb-data.- Returns:
- Returns the size of the pfb-data.
-
getSegment1
public byte[] getSegment1()Returns the first segment- Returns:
- first segment bytes
-
getSegment2
public byte[] getSegment2()Returns the second segment- Returns:
- second segment bytes
-