public class

MappedFile

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

Class Overview

MappedFile is a utility class to read files on a file system. Because MappedFile file is derived from pdftron.Filters.Filter you can directly chain MappedFile objects to other 'pdftron.Filters'. MappedFile objects support random access to files using the Seek method. Seek allows the read/write position to be moved to any position within the file. This is done through a shared memory mapped chunk manager. The byte offset is relative to the seek reference point, which can be the beginning, the current position, or the end of the underlying file, as represented by the three properties of the Filter.ReferencePos class. MappedFile objects are thread-safe, meaning separate copies of a MappedFile can Seek to different locations in the file, without conflicting with one another. Disk files always support random access. At the time of construction, the CanSeek() property value is set to true or false depending on the underlying file type.

Note: .NET or Java applications should explicitly Close() files when they are not needed. If the files are not closed or disposed this may lead to the resource exhaustion.

Summary

Constants
int e_append_mode The Constant e_append_mode.
int e_read_mode The Constant e_read_mode.
int e_write_mode The Constant e_write_mode.
[Expand]
Inherited Fields
From class com.pdftron.filters.Filter
Public Constructors
MappedFile(String filename)
Create a new instance of MappedFile class with the specified path
Public Methods
long fileSize()
Get file size.
[Expand]
Inherited Methods
From class com.pdftron.filters.Filter
From class java.lang.Object

Constants

public static final int e_append_mode

The Constant e_append_mode.

Constant Value: 2 (0x00000002)

public static final int e_read_mode

The Constant e_read_mode.

Constant Value: 0 (0x00000000)

public static final int e_write_mode

The Constant e_write_mode.

Constant Value: 1 (0x00000001)

Public Constructors

public MappedFile (String filename)

Create a new instance of MappedFile class with the specified path

Public Methods

public long fileSize ()

Get file size.

Returns
  • the size of the current file.