Show / Hide Table of Contents

# Class MemoryFilter

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).

##### Inheritance

object
Filter
MemoryFilter

##### Implements

IDisposable

##### Inherited Members

Filter.GetName()
Filter.GetDecodeName()
Filter.Begin()
Filter.Size()
Filter.Consume(int)
Filter.Count()
Filter.SetCount(int)
Filter.SetStreamLength(int)
Filter.AttachFilter(Filter)
Filter.ReleaseAttachedFilter()
Filter.GetAttachedFilter()
Filter.GetSourceFilter()
Filter.Flush()
Filter.FlushAll()
Filter.IsInputFilter()
Filter.CanSeek()
Filter.Seek(int, Filter.ReferencePos)
Filter.Tell()
Filter.CreateInputIterator()
Filter.GetFilePath()
Filter.WriteToFile(string, bool)
Filter.Dispose(bool)
Filter.Dispose()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

###### Namespace: pdftron.Filters

###### Assembly: PDFNet.dll

##### Syntax

    public class MemoryFilter : Filter, IDisposable

### Constructors

#### MemoryFilter(int, bool)

Instantiates a new memory filter.

##### Declaration

    public MemoryFilter(int buf_sz, bool is_input)

##### Parameters

Type | Name | Description
--- | --- | ---
int | buf_sz | buffer size
bool | is_input | whether the Mememory filter is input filter

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

### Methods

#### GetBuffer()

Gets the buffer.

##### Declaration

    public virtual ref byte GetBuffer()

##### Returns

Type | Description
--- | ---
byte | The entire memory buffer.

##### Remarks

MemoryFilter specific function.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Reset()

##### Declaration

    public virtual void Reset()

#### SetAsInputFilter()

Sets this `MemoryFilter` as input filter.

##### Declaration

    public virtual void SetAsInputFilter()

##### Remarks

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

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

### Implements

IDisposable