Class PdfStream

Direct Known Subclasses:
PdfImage, PRStream

public class PdfStream extends PdfDictionary
PdfStream is the Pdf stream object.

A stream, like a string, is a sequence of characters. However, an application can read a small portion of a stream at a time, while a string must be read in its entirety. For this reason, objects with potentially large amounts of data, such as images and page descriptions, are represented as streams.
A stream consists of a dictionary that describes a sequence of characters, followed by the keyword stream, followed by zero or more lines of characters, followed by the keyword endstream.
All streams must be PdfIndirectObjects. The stream dictionary must be a direct object. The keyword stream that follows the stream dictionary should be followed by a carriage return and linefeed or just a linefeed.
Remark: In this version only the FLATEDECODE-filter is supported.
This object is described in the 'Portable Document Format Reference Manual version 1.7' section 3.2.7 (page 60-63).

See Also:
  • Field Details

    • DEFAULT_COMPRESSION

      public static final int DEFAULT_COMPRESSION
      A possible compression level.
      Since:
      2.1.3
      See Also:
    • NO_COMPRESSION

      public static final int NO_COMPRESSION
      A possible compression level.
      Since:
      2.1.3
      See Also:
    • BEST_COMPRESSION

      public static final int BEST_COMPRESSION
      A possible compression level.
      Since:
      2.1.3
      See Also:
    • compressed

      protected boolean compressed
      is the stream compressed?
    • compressionLevel

      protected int compressionLevel
      The level of compression.
      Since:
      2.1.3
    • streamBytes

      protected ByteArrayOutputStream streamBytes
    • inputStream

      protected InputStream inputStream
    • inputStreamLength

      protected int inputStreamLength
    • rawLength

      protected int rawLength
  • Constructor Details

    • PdfStream

      public PdfStream(byte[] bytes)
      Constructs a PdfStream-object.
      Parameters:
      bytes - content of the new PdfObject as an array of byte.
    • PdfStream

      protected PdfStream()
      Constructs a PdfStream-object.
  • Method Details