Class PfbParser


  • public class PfbParser
    extends java.lang.Object
    Parser for a pfb-file.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int ASCII_MARKER
      the ascii marker.
      private static int BINARY_MARKER
      the binary marker.
      private static int BUFFER_SIZE
      buffersize.
      private int[] lengths
      the lengths of the records.
      private static int PFB_HEADER_LENGTH
      the pdf header length.
      private static int[] PFB_RECORDS
      The record types in the pfb-file.
      private byte[] pfbdata
      the parsed pfb-data.
      private static int START_MARKER
      the start marker.
    • Constructor Summary

      Constructors 
      Constructor Description
      PfbParser​(byte[] bytes)
      Create a new object.
      PfbParser​(java.io.InputStream in)
      Create a new object.
      PfbParser​(java.lang.String filename)
      Create a new object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.InputStream getInputStream()
      Returns the pfb data as stream.
      int[] getLengths()
      Returns the lengths.
      byte[] getPfbdata()
      Returns the pfbdata.
      byte[] getSegment1()
      Returns the first segment
      byte[] getSegment2()
      Returns the second segment
      private void parsePfb​(byte[] pfb)
      Parse the pfb-array.
      private byte[] readPfbInput​(java.io.InputStream in)
      Read the pdf input.
      int size()
      Returns the size of the pfb-data.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PFB_HEADER_LENGTH

        private static final int PFB_HEADER_LENGTH
        the pdf header length. (start-marker (1 byte), ascii-/binary-marker (1 byte), size (4 byte)) 3*6 == 18
        See Also:
        Constant Field Values
      • BINARY_MARKER

        private static final int BINARY_MARKER
        the binary marker.
        See Also:
        Constant Field Values
      • PFB_RECORDS

        private static final int[] PFB_RECORDS
        The record types in the pfb-file.
      • pfbdata

        private byte[] pfbdata
        the parsed pfb-data.
      • lengths

        private int[] lengths
        the lengths of the records.
    • Constructor Detail

      • PfbParser

        public PfbParser​(java.lang.String filename)
                  throws java.io.IOException
        Create a new object.
        Parameters:
        filename - the file name
        Throws:
        java.io.IOException - if an IO-error occurs.
      • PfbParser

        public PfbParser​(java.io.InputStream in)
                  throws java.io.IOException
        Create a new object.
        Parameters:
        in - The input.
        Throws:
        java.io.IOException - if an IO-error occurs.
      • PfbParser

        public PfbParser​(byte[] bytes)
                  throws java.io.IOException
        Create a new object.
        Parameters:
        bytes - The input.
        Throws:
        java.io.IOException - if an IO-error occurs.
    • Method Detail

      • parsePfb

        private void parsePfb​(byte[] pfb)
                       throws java.io.IOException
        Parse the pfb-array.
        Parameters:
        pfb - The pfb-Array
        Throws:
        java.io.IOException - in an IO-error occurs.
      • readPfbInput

        private byte[] readPfbInput​(java.io.InputStream in)
                             throws java.io.IOException
        Read the pdf input.
        Parameters:
        in - The input.
        Returns:
        Returns the pdf-array.
        Throws:
        java.io.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

        public java.io.InputStream 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