public class PRStream extends PdfStream
| Modifier and Type | Field and Description | 
|---|---|
| protected int | length | 
| protected int | objGen | 
| protected int | objNum | 
| protected long | offset | 
| protected PdfReader | reader | 
BEST_COMPRESSION, BEST_SPEED, compressed, compressionLevel, DEFAULT_COMPRESSION, inputStream, inputStreamLength, NO_COMPRESSION, rawLength, ref, streamBytes, writer| Constructor and Description | 
|---|
| PRStream(PdfReader reader,
        byte[] conts) | 
| PRStream(PdfReader reader,
        byte[] conts,
        int compressionLevel)Creates a new PDF stream object that will replace a stream
 in a existing PDF file. | 
| PRStream(PdfReader reader,
        long offset) | 
| PRStream(PRStream stream,
        PdfDictionary newDic) | 
| PRStream(PRStream stream,
        PdfDictionary newDic,
        PdfReader reader) | 
| Modifier and Type | Method and Description | 
|---|---|
| byte[] | getBytes()Gets the presentation of this object in a byte array | 
| int | getLength() | 
| long | getOffset() | 
| PdfReader | getReader() | 
| void | setData(byte[] data)Sets the data associated with the stream | 
| void | setData(byte[] data,
       boolean compress)Sets the data associated with the stream, either compressed or
 uncompressed. | 
| void | setData(byte[] data,
       boolean compress,
       int compressionLevel)Sets the data associated with the stream, either compressed or
 uncompressed. | 
| void | setDataRaw(byte[] data)Sets the data associated with the stream, as-is. | 
| void | setLength(int length) | 
| void | setObjNum(int objNum,
         int objGen) | 
| void | toPdf(PdfWriter writer,
     OutputStream os)Writes the PDF representation of this  PdfDictionaryas an
 array ofbyteto the givenOutputStream. | 
flateCompress, flateCompress, getRawLength, superToPdf, toString, writeContent, writeLengthcheckType, clear, contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, sizecanBeInObjStm, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, typeprotected PdfReader reader
protected long offset
protected int length
protected int objNum
protected int objGen
public PRStream(PRStream stream, PdfDictionary newDic)
public PRStream(PRStream stream, PdfDictionary newDic, PdfReader reader)
public PRStream(PdfReader reader, long offset)
public PRStream(PdfReader reader, byte[] conts)
public PRStream(PdfReader reader, byte[] conts, int compressionLevel)
reader - the reader that holds the existing PDFconts - the new contentcompressionLevel - the compression level for the contentpublic void setData(byte[] data,
                    boolean compress)
data - raw data, decrypted and uncompressed.compress - true if you want the stream to be compressed.public void setData(byte[] data,
                    boolean compress,
                    int compressionLevel)
data - raw data, decrypted and uncompressed.compress - true if you want the stream to be compressed.compressionLevel - a value between -1 and 9 (ignored if compress == false)public void setDataRaw(byte[] data)
data - data, possibly encrypted and/or compressedpublic void setData(byte[] data)
data - raw data, decrypted and uncompressed.public void setLength(int length)
public long getOffset()
public int getLength()
public PdfReader getReader()
public byte[] getBytes()
PdfObjectpublic void setObjNum(int objNum,
                      int objGen)
public void toPdf(PdfWriter writer, OutputStream os) throws IOException
PdfDictionaryPdfDictionary as an
 array of byte to the given OutputStream.toPdf in class PdfStreamwriter - for backwards compatibilityos - the OutputStream to write the bytes to.IOExceptionPdfDictionary.toPdf(com.itextpdf.text.pdf.PdfWriter, java.io.OutputStream)Copyright © 2020. All rights reserved.