Class PDFBuffer

  • Direct Known Subclasses:
    PDFPage

    public class PDFBuffer
    extends PDFOutput
    This class is like a StringBuffer, but for creating PDF files instead of strings. It resides entirely in memory so it should be used sparingly. The preferred PDFOutput implementation is PDFOutputStream to prevent large PDF assets from being held in memory.
    • Field Detail

      • _source

        protected final java.io.ByteArrayOutputStream _source
    • Constructor Detail

      • PDFBuffer

        public PDFBuffer()
    • Method Detail

      • length

        public long length()
        Description copied from class: PDFOutput
        Returns the current length of the output.
        Specified by:
        length in class PDFOutput
      • append

        public PDFOutput append​(char aChar)
        Description copied from class: PDFOutput
        Adds a character to the pdf buffer.
        Specified by:
        append in class PDFOutput
      • append

        public PDFOutput append​(byte[] theBytes,
                                int anOffset,
                                int aLength)
        Description copied from class: PDFOutput
        Appends an arbitrary byte array with the given offset and length.
        Specified by:
        append in class PDFOutput
      • toByteArray

        public byte[] toByteArray()