java.lang.Object | |
↳ | com.pdftron.filters.FilterWriter |
FilterWriter is a utility class providing a convenient way to write data
to an output filter (using Filter directly is not very intuitive).
For example:
StdFile outfile=new StdFile("file.dat"), StdFile.e_write_mode);
FilterWriter fwriter=new FilterWriter(outfile);
byte[] buf=...
fwriter.writeBuffer(buf);
fwriter.flush();
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FilterWriter()
Instantiates a new filter writer.
| |||||||||||
FilterWriter(Filter filter)
Instantiates a new filter writer for specified Filter
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
long | __GetHandle() | ||||||||||
void |
attachFilter(Filter filter)
Attaches a filter to the this FilterWriter.
| ||||||||||
void |
close()
Frees the native memory of the object.
| ||||||||||
long |
count()
Count number of bytes consumed since opening the filter or seek operation
| ||||||||||
void |
destroy()
Frees the native memory of the object.
| ||||||||||
void |
flush()
Forces any data remaining in the buffer to be written to input or output filter.
| ||||||||||
void |
flushAll()
Forces any data remaining in the filter chain to the source or destination.
| ||||||||||
Filter |
getAttachedFilter()
Get the attached filter.
| ||||||||||
void |
seek(long offset, int origin)
Set the position within the current stream.
| ||||||||||
long |
tell()
Reports the current read position in the stream relative to the stream origin.
| ||||||||||
long |
writeBuffer(byte[] buf)
Write buffer.
| ||||||||||
void |
writeFilter(FilterReader reader)
Write the entire input stream to the output stream (i.e.
| ||||||||||
void |
writeInt(int num)
Write an integer to the output stream.
| ||||||||||
void |
writeLine(String line)
Write out a null terminated 'line' followed by a end of line character
default end of line character is carriage return.
| ||||||||||
void |
writeString(String str)
Write a string to the output stream.
| ||||||||||
void |
writeUChar(byte ch)
Write a single character to the output stream.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.lang.AutoCloseable
|
Instantiates a new filter writer for specified Filter
filter | the filter |
---|
PDFNetException |
---|
Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.
PDFNetException |
---|
Count number of bytes consumed since opening the filter or seek operation
PDFNetException |
---|
Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.
PDFNetException |
---|
Forces any data remaining in the buffer to be written to input or output filter.
PDFNetException |
---|
Forces any data remaining in the filter chain to the source or destination.
PDFNetException |
---|
Get the attached filter.
PDFNetException |
---|
Set the position within the current stream.
Note: - After each Seek() operation the number of consumed bytes (i.e. Count()) is set to 0.
offset | - A byte offset relative to origin. If offset is negative, the new position will precede the position specified by origin by the number of bytes specified by offset. If offset is zero, the new position will be the position specified by origin. If offset is positive, the new position will follow the position specified by origin by the number of bytes specified by offset. |
---|---|
origin | - A value of type ReferencePos indicating the reference point used to obtain the new position |
PDFNetException |
---|
Reports the current read position in the stream relative to the stream origin.
PDFNetException |
---|
Write buffer.
buf | the buf |
---|
PDFNetException |
---|
Write the entire input stream to the output stream (i.e. to this FilterWriter).
reader | A FilterReader attached to an input stream. |
---|
PDFNetException |
---|
Write an integer to the output stream.
num | An integer to write to the output stream. |
---|
PDFNetException |
---|
Write out a null terminated 'line' followed by a end of line character default end of line character is carriage return.
line | the line |
---|
PDFNetException |
---|
Write a string to the output stream.
str | A string to write to the output stream. |
---|
PDFNetException |
---|
Write a single character to the output stream.
ch | An unsigned character to write to the output stream. |
---|
PDFNetException |
---|