Class PDFCCITTFaxProducer

  • All Implemented Interfaces:
    java.awt.image.ImageProducer, java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class PDFCCITTFaxProducer
    extends java.io.OutputStream
    implements java.awt.image.ImageProducer
    This class is an image producer that uses the RBCodecCCITTFaxDecoder to produce the bits of a 1bpp monochrome image. This is used as an optimization for when decoding the entire image at once would be too expensive. Instead of holding on to all the bytes of a decompressed 8bpp BufferedImage, this class holds on to the compressed bit stream and produces the image as needed.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addConsumer​(java.awt.image.ImageConsumer ic)
      ImageProducer method - add a new consumer
      void flush()  
      RBCodecCCITTFaxDecode getCodec()
      returns the decoder, should you need it.
      boolean isConsumer​(java.awt.image.ImageConsumer ic)
      ImageProducer method - check to see if we are sending bits to ic
      void produce()
      The blood & guts
      void removeConsumer​(java.awt.image.ImageConsumer ic)
      ImageProducer method
      void requestTopDownLeftRightResend​(java.awt.image.ImageConsumer ic)
      ImageProducer method - send all the bits to the given consumer
      void startProduction​(java.awt.image.ImageConsumer ic)
      ImageProducer method - kicks things off.
      void write​(byte[] b)  
      void write​(int b)  
      • Methods inherited from class java.io.OutputStream

        close, nullOutputStream, write
      • Methods inherited from class java.lang.Object

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

      • PDFCCITTFaxProducer

        public PDFCCITTFaxProducer​(RBCodecCCITTFaxDecode decoder)
        Create a new image producer for the codec.
    • Method Detail

      • addConsumer

        public void addConsumer​(java.awt.image.ImageConsumer ic)
        ImageProducer method - add a new consumer
        Specified by:
        addConsumer in interface java.awt.image.ImageProducer
      • isConsumer

        public boolean isConsumer​(java.awt.image.ImageConsumer ic)
        ImageProducer method - check to see if we are sending bits to ic
        Specified by:
        isConsumer in interface java.awt.image.ImageProducer
      • removeConsumer

        public void removeConsumer​(java.awt.image.ImageConsumer ic)
        ImageProducer method
        Specified by:
        removeConsumer in interface java.awt.image.ImageProducer
      • startProduction

        public void startProduction​(java.awt.image.ImageConsumer ic)
        ImageProducer method - kicks things off.
        Specified by:
        startProduction in interface java.awt.image.ImageProducer
      • requestTopDownLeftRightResend

        public void requestTopDownLeftRightResend​(java.awt.image.ImageConsumer ic)
        ImageProducer method - send all the bits to the given consumer
        Specified by:
        requestTopDownLeftRightResend in interface java.awt.image.ImageProducer
      • produce

        public void produce()
        The blood & guts
      • write

        public void write​(byte[] b)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException