public class

MemoryFilter

extends Filter
java.lang.Object
   ↳ com.pdftron.filters.Filter
     ↳ com.pdftron.filters.MemoryFilter

Class Overview

MemoryFilter is a memory buffer that can be used as a source or a sink Filter in the Filter pipeline. When a MemoryFilter is the source, other filters can read data stored in memory; When MemoryFilter is a sink, other filters generate data which is then pushed in a memory buffer owned by MemoryFilter (MemoryFilter makes sure that there is enough space to accomodate all data).

Summary

Public Constructors
MemoryFilter(long buf_sz, boolean is_input)
Instantiates a new memory filter with specified buffer size.
Public Methods
byte[] getBuffer()
Get the memory buffer

Note: MemoryFilter specific function.

void setAsInputFilter()
Set the MemoryBuffer as input filter

Note: MemoryFilter-specific function used to change filter mode from output to input.

[Expand]
Inherited Methods
From class com.pdftron.filters.Filter
From class java.lang.Object
From interface java.lang.AutoCloseable

Public Constructors

public MemoryFilter (long buf_sz, boolean is_input)

Instantiates a new memory filter with specified buffer size.

Parameters
buf_sz the buffer size
is_input determine whether the MemoryFilter is input or not

Public Methods

public byte[] getBuffer ()

Get the memory buffer

Note: MemoryFilter specific function.

Returns
  • entire memory buffer.

public void setAsInputFilter ()

Set the MemoryBuffer as input filter

Note: MemoryFilter-specific function used to change filter mode from output to input. The utility function is useful in cases when an output data buffer should be converted to an input stream.

Note: The function has no effect on an input MemoryFilter.