|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.pdf.writer.COSWriter
public class COSWriter
A writer for PDF related data structures.
Field Summary | |
---|---|
static byte[] |
ARRAY_CLOSE
|
static byte[] |
ARRAY_OPEN
|
static byte[] |
COMMENT
|
static byte[] |
CRLF
To be used when 2 byte sequence is enforced. |
static byte[] |
DICT_CLOSE
|
static byte[] |
DICT_OPEN
|
static byte[] |
ENDOBJ
|
static byte[] |
ENDSTREAM
|
static byte[] |
EOF
|
static byte[] |
EOL
standard line separator on this platform |
static byte[] |
FALSE
|
static byte[] |
GARBAGE
|
static byte[] |
LF
Line feed character. |
static byte[] |
LITERAL_ESCAPED_BS
|
static byte[] |
LITERAL_ESCAPED_CR
|
static byte[] |
LITERAL_ESCAPED_FF
|
static byte[] |
LITERAL_ESCAPED_HT
|
static byte[] |
LITERAL_ESCAPED_LF
|
static byte[] |
NAME_ESCAPE
|
static byte[] |
NAME_PREFIX
|
static byte[] |
NULL
|
static byte[] |
OBJ
|
static byte[] |
PDF_ESCAPE
|
static byte[] |
REFERENCE
|
static byte[] |
SPACE
|
static byte[] |
STREAM
|
static byte[] |
STRING_CLOSE
|
static byte[] |
STRING_HEX_CLOSE
|
static byte[] |
STRING_HEX_OPEN
|
static byte[] |
STRING_OPEN
|
static byte[] |
TRAILER
|
static byte[] |
TRUE
|
Constructor Summary | |
---|---|
COSWriter(IRandomAccess randomAccess,
ISystemSecurityHandler securityHandler)
|
Method Summary | |
---|---|
static void |
basicWriteFixed(IRandomAccess randomAccess,
float value,
int precision)
|
static void |
basicWriteInteger(IRandomAccess randomAccess,
int value)
|
static void |
basicWriteName(IRandomAccess randomAccess,
byte[] name)
create the byte stream for the representation of a name |
static void |
basicWriteStringHex(IRandomAccess randomAccess,
byte[] string)
create a hex encoded byte stream representation of string |
static void |
basicWriteStringLiteral(IRandomAccess randomAccess,
byte[] string)
create the literal byte stream representation of string |
List |
getProxies()
The collection of proxies to COSObjects visited by the writer. |
IRandomAccess |
getRandomAccess()
|
boolean |
isIncremental()
|
void |
seekToEnd()
|
void |
setIncremental(boolean incremental)
|
static byte[] |
toByteArray(COSObject object)
Create a byte array representation from a COSObject. |
Object |
visitFromArray(COSArray obj)
visitFromArray. |
Object |
visitFromBoolean(COSBoolean obj)
visitFromBoolean. |
Object |
visitFromDictionary(COSDictionary obj)
visitFromDictionary. |
Object |
visitFromFixed(COSFixed obj)
visitFromFixed. |
Object |
visitFromIndirectObject(COSIndirectObject obj)
This will write an indirect object reference |
Object |
visitFromInteger(COSInteger obj)
visitFromInteger. |
Object |
visitFromName(COSName obj)
visitFromName. |
Object |
visitFromNull(COSNull obj)
visitFromNull. |
Object |
visitFromProxy(COSObjectProxy obj)
Notification of visit to COSObjectProxy object. |
Object |
visitFromStream(COSStream obj)
visitFromStream. |
Object |
visitFromString(COSString obj)
visitFromString. |
void |
write(byte[] b)
This will write some byte to the stream. |
void |
write(byte[] b,
int off,
int len)
This will write some byte to the stream. |
void |
write(int b)
This will write a single byte to the stream. |
void |
writeContentStream(CSContent contentStream)
|
void |
writeDocument(STDocument doc)
|
void |
writeEOL()
This will write an EOL to the stream. |
void |
writeIndirectObject(COSIndirectObject object)
|
void |
writeObject(COSObject object)
This will write a cos object to the stream |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte[] ARRAY_CLOSE
public static final byte[] ARRAY_OPEN
public static final byte[] COMMENT
public static final byte[] CRLF
public static final byte[] DICT_CLOSE
public static final byte[] DICT_OPEN
public static final byte[] ENDOBJ
public static final byte[] ENDSTREAM
public static final byte[] EOF
public static final byte[] EOL
public static final byte[] FALSE
public static final byte[] GARBAGE
public static final byte[] LF
public static final byte[] LITERAL_ESCAPED_BS
public static final byte[] LITERAL_ESCAPED_CR
public static final byte[] LITERAL_ESCAPED_FF
public static final byte[] LITERAL_ESCAPED_HT
public static final byte[] LITERAL_ESCAPED_LF
public static final byte[] NAME_ESCAPE
public static final byte[] NAME_PREFIX
public static final byte[] NULL
public static final byte[] OBJ
public static final byte[] PDF_ESCAPE
public static final byte[] REFERENCE
public static final byte[] SPACE
public static final byte[] STREAM
public static final byte[] STRING_CLOSE
public static final byte[] STRING_HEX_CLOSE
public static final byte[] STRING_HEX_OPEN
public static final byte[] STRING_OPEN
public static final byte[] TRAILER
public static final byte[] TRUE
Constructor Detail |
---|
public COSWriter(IRandomAccess randomAccess, ISystemSecurityHandler securityHandler)
Method Detail |
---|
public static void basicWriteFixed(IRandomAccess randomAccess, float value, int precision) throws IOException
IOException
public static void basicWriteInteger(IRandomAccess randomAccess, int value) throws IOException
IOException
public static void basicWriteName(IRandomAccess randomAccess, byte[] name) throws IOException
randomAccess
- the randomAccessData to write toname
- the names byte stream
IOException
public static void basicWriteStringHex(IRandomAccess randomAccess, byte[] string) throws IOException
randomAccess
- the randomAccessData to write tostring
- the string to write
IOException
public static void basicWriteStringLiteral(IRandomAccess randomAccess, byte[] string) throws IOException
randomAccess
- the randomAccessData to write tostring
- the string to write
IOException
public static final byte[] toByteArray(COSObject object)
object
- The object to be serialized.
public List getProxies()
public IRandomAccess getRandomAccess()
public boolean isIncremental()
public void seekToEnd() throws IOException
IOException
public void setIncremental(boolean incremental)
public Object visitFromArray(COSArray obj) throws COSVisitorException
visitFromArray
in interface ICOSObjectVisitor
obj
- The object that is being visited.
COSVisitorException
- If there is an exception while visiting this object.public Object visitFromBoolean(COSBoolean obj) throws COSVisitorException
visitFromBoolean
in interface ICOSObjectVisitor
obj
- The object that is being visited.
COSVisitorException
- If there is an exception while visiting this object.public Object visitFromDictionary(COSDictionary obj) throws COSVisitorException
visitFromDictionary
in interface ICOSObjectVisitor
obj
- The object that is being visited.
COSVisitorException
- If there is an exception while visiting this object.public Object visitFromFixed(COSFixed obj) throws COSVisitorException
visitFromFixed
in interface ICOSObjectVisitor
obj
- The object that is being visited.
COSVisitorException
- If there is an exception while visiting this object.public Object visitFromIndirectObject(COSIndirectObject obj) throws COSVisitorException
visitFromIndirectObject
in interface ICOSObjectVisitor
obj
- The indirect object to write.
COSVisitorException
- If there is an exception while visiting this object.public Object visitFromInteger(COSInteger obj) throws COSVisitorException
visitFromInteger
in interface ICOSObjectVisitor
obj
- The object that is being visited.
COSVisitorException
- If there is an exception while visiting this object.public Object visitFromName(COSName obj) throws COSVisitorException
visitFromName
in interface ICOSObjectVisitor
obj
- The object that is being visited.
COSVisitorException
- If there is an exception while visiting this object.public Object visitFromNull(COSNull obj) throws COSVisitorException
visitFromNull
in interface ICOSObjectVisitor
obj
- The object that is being visited.
COSVisitorException
- If there is an exception while visiting this object.public Object visitFromProxy(COSObjectProxy obj) throws COSVisitorException
ICOSProxyVisitor
COSObjectProxy
object.
visitFromProxy
in interface ICOSProxyVisitor
obj
- The Object that is being visited.
COSVisitorException
- If there is an error while visiting this object.public Object visitFromStream(COSStream obj) throws COSVisitorException
visitFromStream
in interface ICOSObjectVisitor
obj
- The object that is being visited.
COSVisitorException
- If there is an exception while visiting this object.public Object visitFromString(COSString obj) throws COSVisitorException
visitFromString
in interface ICOSObjectVisitor
obj
- The object that is being visited.
COSVisitorException
- If there is an exception while visiting this object.public void write(byte[] b) throws IOException
b
- The source byte array.
IOException
- If the underlying stream throws an exception.public void write(byte[] b, int off, int len) throws IOException
b
- The source byte array.off
- The offset into the array to start writing.len
- The number of bytes to write.
IOException
- If the underlying stream throws an exception.public void write(int b) throws IOException
b
- The byte to write to the stream.
IOException
- If there is an error writing to the underlying stream.public void writeContentStream(CSContent contentStream) throws IOException
IOException
public void writeDocument(STDocument doc) throws IOException
IOException
public void writeEOL() throws IOException
IOException
- If there is an error writing to the streampublic void writeIndirectObject(COSIndirectObject object) throws IOException
IOException
public void writeObject(COSObject object) throws IOException
object
- the object to write
IOException
- If an error occurs while generating the data.
|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |