Class COSFilterASCIIReader

java.lang.Object
org.verapdf.as.filters.io.COSFilterASCIIReader

public class COSFilterASCIIReader extends Object
This is class-helper for decoding ASCII85 and ASCII Hex strings. It reads next required amount of bytes and guarantees that white-space characters will be skipped. It also looks for end of data.
Author:
Sergey Shemyakov
  • Constructor Details

    • COSFilterASCIIReader

      public COSFilterASCIIReader(ASInputStream stream, boolean isASCIIHex)
      Constructor from encoded stream.
      Parameters:
      stream - is ASCII Hex or ASCII85 encoded stream.
      isASCIIHex - is true if stream ASCII Hex encoded, false if stream is ASCII85 encoded.
  • Method Details

    • getNextBytes

      public byte[] getNextBytes() throws IOException
      Method gets next portion of bytes: two for ASCII Hex encoding and five for ASCII85 encoding. It ignores all the white-space characters.
      Returns:
      null if end of stream is reached and next portion of bytes otherwise. If ASCII85 is chosen, method can return less than 5 bytes in case if they are last group of bytes in data string.
      Throws:
      IOException