Summary: Inherited Constants | Ctors | Methods | Inherited Methods | [Expand All]
public class

# FileDescriptorReadOnlyFilter

extends CustomFilter
implements AutoCloseable

java.lang.Object
↳ | com.pdftron.filters.Filter
| ↳ | com.pdftron.filters.CustomFilter
|  | ↳ | com.pdftron.filters.FileDescriptorReadOnlyFilter

## Summary

[Expand] Inherited Constants
From class com.pdftron.filters.CustomFilter
int | APPEND_MODE | Filter is in append mode.
int | READ_MODE | Filter is in read mode.
int | SEEK_CUR | The offset is relative to the current position of the filter.
int | SEEK_END | The offset is relative to the end of the filter.
int | SEEK_SET | The offset is relative to the beginning of the filter.
String | TAG |
int | WRITE_MODE | Filter is in write mode.

Public Constructors
| FileDescriptorReadOnlyFilter(int mode, Object obj)

Public Methods
void | close() Frees the native memory of the object.
long | onCreateInputIterator(Object user_object)
void | onDestroy(Object user_object)
long | onFlush(Object user_object) The abstract function in which the output data is flushed.
long | onRead(byte[] bytes, Object o) The abstract function in which the input data are read.
long | onSeek(long offset, int origin, Object user_object) The abstract function in which the position indicator of the filter is set.
long | onTell(Object user_object) The abstract function in which the position indicator of the filter is queried.
long | onWrite(byte[] buf, Object user_object) The abstract function in which the data are output.

[Expand] Inherited Methods
From class com.pdftron.filters.CustomFilter
abstract void | close() Frees the native memory of the object.
void | destroy() Frees the native memory of the object.
String | getName() Gets the name of the filter.
Object | getUserObject() Gets the user data from `CustomFilter(int, Object)`.
abstract long | onCreateInputIterator(Object user_object)
abstract void | onDestroy(Object user_object)
abstract long | onFlush(Object user_object) The abstract function in which the output data is flushed.
abstract long | onRead(byte[] buf, Object user_object) The abstract function in which the input data are read.
abstract long | onSeek(long offset, int origin, Object user_object) The abstract function in which the position indicator of the filter is set.
abstract long | onTell(Object user_object) The abstract function in which the position indicator of the filter is queried.
long | onTruncate(long new_size, Object user_object) The abstract function the size of the filter is set
abstract long | onWrite(byte[] buf, Object user_object) The abstract function in which the data are output.
From class com.pdftron.filters.Filter
static Filter | __Create(long impl, Filter attached)
long | __GetHandle()
void | __SetRefHandle(Object ref)
void | attachFilter(Filter attach_filter) Attaches a filter to the this filter.
boolean | canSeek() determine whether the stream supports seeking
void | close() Frees the native memory of the object.
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.
String | getDecodeName() Get the decode name.
String | getFilePath() Get the file path.
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 | size() Returns the size of buffer returned by Begin().
long | tell() Reports the current read position in the stream relative to the stream origin.
void | writeToFile(String path, boolean append) Writes the entire filter, starting at current position, to specified filepath.
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()
From interface java.lang.AutoCloseable
abstract void | close()

## Public Constructors

#### public FileDescriptorReadOnlyFilter (int mode, Object obj)

##### Throws

PDFNetException |

## Public Methods

#### public void close ()

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.

#### public long onCreateInputIterator (Object user_object)

#### public void onDestroy (Object user_object)

#### public long onFlush (Object user_object)

The abstract function in which the output data is flushed.

##### Parameters

user_object | The user data from passed in via #CustomFilter(int, Object).

##### Returns

- If successful, the value is 0; otherwise, it is non-zero.

#### public long onRead (byte[] bytes, Object o)

The abstract function in which the input data are read.

##### Parameters

bytes | The buffer to contain the data to read, which has already been allocated.
o | The user data from passed in via #CustomFilter(int, Object).

##### Returns

- The number of bytes read. It should return 0 if it fails or reaches the end of the input stream.

#### public long onSeek (long offset, int origin, Object user_object)

The abstract function in which the position indicator of the filter is set.

##### Parameters

offset | Number of bytes to offset from origin. A positive value implies the indicator is moved forward, and a negative value implies the indicator is moved backward.
origin | Position from where offset is added. It is specified by one of the following: `SEEK_SET`, `SEEK_CUR`, `SEEK_END`.
user_object | The user data from passed in via #CustomFilter(int, Object).

##### Returns

- The new position of the indicator set. If successful, the value is 0; otherwise, it is non-zero.

#### public long onTell (Object user_object)

The abstract function in which the position indicator of the filter is queried.

##### Parameters

user_object | The user data from passed in via #CustomFilter(int, Object).

##### Returns

- The position of the indicator.

#### public long onWrite (byte[] buf, Object user_object)

The abstract function in which the data are output.

##### Parameters

buf | The buffer to contain the data to write out.
user_object | The user data from passed in via #CustomFilter(int, Object).

##### Returns

- The number of bytes successfully written.