public class Filter
extends java.lang.Object
Note: To read or write data to a filter, a user will tipically use FilterReader/FilterWriter class instead of using Filter methods. For example:
MappedFile file = new MappedFile("my_stream.txt");
FilterReader reader = new FilterReader(file);
while (reader.read(...)) ...
Modifier and Type | Method and Description |
---|---|
static Filter |
__Create(long impl,
Filter attached) |
long |
__GetHandle() |
void |
__SetRefHandle(java.lang.Object ref) |
void |
attachFilter(Filter attach_filter)
Attaches a filter to the this filter.
|
boolean |
canSeek()
determine whether the stream supports seeking
|
Filter |
createInputIterator()
Create Filter iterator.
|
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.
|
java.lang.String |
getDecodeName()
Get the decode name.
|
java.lang.String |
getFilePath()
Get the file path.
|
java.lang.String |
getName()
Get the name.
|
Filter |
getSourceFilter()
Get the source filter.
|
boolean |
isInputFilter()
Checks if is input filter.
|
Filter |
releaseAttachedFilter()
Release the ownership of the attached filter.
|
void |
seek(long offset,
int origin)
When overridden in a derived class, sets the position within the current stream.
|
void |
setStreamLength(long bytes)
The functions specifies the length of the data stream.
|
long |
tell()
Reports the current read position in the stream relative to the stream origin.
|
void |
writeToFile(java.lang.String path,
boolean append)
Writes the entire filter, starting at current position, to
specified filepath.
|
public void destroy() throws PDFNetException
PDFNetException
public void attachFilter(Filter attach_filter) throws PDFNetException
attach_filter
- the attach_filterPDFNetException
public Filter releaseAttachedFilter() throws PDFNetException
PDFNetException
public Filter getAttachedFilter() throws PDFNetException
PDFNetException
public Filter getSourceFilter() throws PDFNetException
PDFNetException
public java.lang.String getName() throws PDFNetException
PDFNetException
public java.lang.String getDecodeName() throws PDFNetException
PDFNetException
public void setStreamLength(long bytes) throws PDFNetException
bytes
- the new stream lengthPDFNetException
public void flush() throws PDFNetException
PDFNetException
public void flushAll() throws PDFNetException
PDFNetException
public boolean isInputFilter() throws PDFNetException
PDFNetException
public boolean canSeek() throws PDFNetException
PDFNetException
public void seek(long offset, int origin) throws PDFNetException
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 positionPDFNetException
public long tell() throws PDFNetException
PDFNetException
public Filter createInputIterator() throws PDFNetException
Note: - Derived classes should make sure that there is only one owner of the attached stream. Otherwise the attached stream may be deleted several times.
PDFNetException
public java.lang.String getFilePath() throws PDFNetException
PDFNetException
public void writeToFile(java.lang.String path, boolean append)
path
- the output filepath.append
- 'true' to append to existing file contents, 'false' to overwrite.public long __GetHandle()
public void __SetRefHandle(java.lang.Object ref)