java.lang.Object | |
↳ | com.pdftron.filters.FilterReader |
FilterReader is a utility class providing a convenient way to read data from an input filter (using Filter directly is not very intuitive). For example:
StdFile file=new StdFile("my_stream.txt"), StdFile.e_read_mode );
FilterReader reader=new FilterReader(file);
while (reader.Read(...)) ...
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FilterReader()
Instantiates a new filter reader.
| |||||||||||
FilterReader(Filter filter)
Instantiates a new filter reader for the specified Filter
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
long | __GetHandle() | ||||||||||
void |
attachFilter(Filter filter)
Attaches a filter to the this FilterReader.
| ||||||||||
void |
close()
Frees the native memory of the object.
| ||||||||||
long |
count()
Count number of bytes consume since last seek opertion or opening filter
| ||||||||||
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.
| ||||||||||
int |
get()
Get the next character from stream
| ||||||||||
Filter |
getAttachedFilter()
Get the attached filter.
| ||||||||||
int |
peek()
Get the next character without extracting it
| ||||||||||
long | read(byte[] buf) | ||||||||||
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.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.lang.AutoCloseable
|
Instantiates a new filter reader for the 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 consume since last seek opertion or opening 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 |
---|
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 next character from stream
PDFNetException |
---|
Get the attached filter.
PDFNetException |
---|
Get the next character without extracting it
PDFNetException |
---|
buf | the buffer to read |
---|
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 |
---|