Package com.aowagie.text.pdf
Class PRStream
- java.lang.Object
-
- com.aowagie.text.pdf.PdfObject
-
- com.aowagie.text.pdf.PdfDictionary
-
- com.aowagie.text.pdf.PdfStream
-
- com.aowagie.text.pdf.PRStream
-
public class PRStream extends PdfStream
-
-
Field Summary
Fields Modifier and Type Field Description private int
length
private int
objGen
private int
objNum
private int
offset
private PdfReader
reader
-
Fields inherited from class com.aowagie.text.pdf.PdfStream
BEST_COMPRESSION, compressed, compressionLevel, DEFAULT_COMPRESSION, ENDSTREAM, inputStream, inputStreamLength, NO_COMPRESSION, rawLength, STARTSTREAM, streamBytes
-
Fields inherited from class com.aowagie.text.pdf.PdfDictionary
CATALOG, hashMap, OUTLINES, PAGE
-
Fields inherited from class com.aowagie.text.pdf.PdfObject
ARRAY, BOOLEAN, bytes, DICTIONARY, INDIRECT, NAME, NOTHING, NULL, NUMBER, STREAM, STRING, TEXT_PDFDOCENCODING, TEXT_UNICODE, type
-
-
Constructor Summary
Constructors Constructor Description 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, int offset)
PRStream(PRStream stream, PdfDictionary newDic)
PRStream(PRStream stream, PdfDictionary newDic, PdfReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBytes()
Gets the presentation of this object in a byte arrayint
getLength()
(package private) int
getObjGen()
(package private) int
getObjNum()
int
getOffset()
PdfReader
getReader()
void
setData(byte[] data)
Sets the data associated with the streamprivate void
setData(byte[] data, boolean compress)
Sets the data associated with the stream, either compressed or uncompressed.private void
setData(byte[] data, boolean compress, int compressionLevel)
Sets the data associated with the stream, either compressed or uncompressed.void
setLength(int length)
(package private) void
setObjNum(int objNum, int objGen)
void
toPdf(PdfWriter writer, java.io.OutputStream os)
Writes the PDF representation of thisPdfDictionary
as an array ofbyte
to the givenOutputStream
.-
Methods inherited from class com.aowagie.text.pdf.PdfStream
flateCompress, getRawLength, superToPdf, toString, writeContent, writeLength
-
Methods inherited from class com.aowagie.text.pdf.PdfDictionary
contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, remove, size
-
Methods inherited from class com.aowagie.text.pdf.PdfObject
canBeInObjStm, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, setContent, setIndRef, type
-
-
-
-
Field Detail
-
reader
private PdfReader reader
-
offset
private int offset
-
length
private int length
-
objNum
private int objNum
-
objGen
private int objGen
-
-
Constructor Detail
-
PRStream
PRStream(PRStream stream, PdfDictionary newDic)
-
PRStream
PRStream(PRStream stream, PdfDictionary newDic, PdfReader reader)
-
PRStream
PRStream(PdfReader reader, int offset)
-
PRStream
PRStream(PdfReader reader, byte[] conts, int compressionLevel)
Creates a new PDF stream object that will replace a stream in a existing PDF file.- Parameters:
reader
- the reader that holds the existing PDFconts
- the new contentcompressionLevel
- the compression level for the content- Since:
- 2.1.3 (replacing the existing constructor without param compressionLevel)
-
-
Method Detail
-
setData
private void setData(byte[] data, boolean compress)
Sets the data associated with the stream, either compressed or uncompressed. Note that the data will never be compressed if Document.compress is set to false.- Parameters:
data
- raw data, decrypted and uncompressed.compress
- true if you want the stream to be compressed.- Since:
- iText 2.1.1
-
setData
private void setData(byte[] data, boolean compress, int compressionLevel)
Sets the data associated with the stream, either compressed or uncompressed. Note that the data will never be compressed if Document.compress is set to false.- Parameters:
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)- Since:
- iText 2.1.3
-
setData
public void setData(byte[] data)
Sets the data associated with the stream- Parameters:
data
- raw data, decrypted and uncompressed.
-
setLength
public void setLength(int length)
-
getOffset
public int getOffset()
-
getLength
public int getLength()
-
getReader
public PdfReader getReader()
-
getBytes
public byte[] getBytes()
Description copied from class:PdfObject
Gets the presentation of this object in a byte array
-
setObjNum
void setObjNum(int objNum, int objGen)
-
getObjNum
int getObjNum()
-
getObjGen
int getObjGen()
-
toPdf
public void toPdf(PdfWriter writer, java.io.OutputStream os) throws java.io.IOException
Description copied from class:PdfDictionary
Writes the PDF representation of thisPdfDictionary
as an array ofbyte
to the givenOutputStream
.- Overrides:
toPdf
in classPdfStream
- Parameters:
writer
- for backwards compatibilityos
- theOutputStream
to write the bytes to.- Throws:
java.io.IOException
- Exception with a I/O error- See Also:
PdfDictionary.toPdf(com.aowagie.text.pdf.PdfWriter, java.io.OutputStream)
-
-