iText 7 7.1.8 API
iText.IO.Source.RandomAccessSourceFactory Class Reference

Factory to create RandomAccessSource objects based on various types of sources More...

Public Member Functions

  RandomAccessSourceFactory ()
  Creates a factory that will give preference to accessing the underling data source using memory mapped files More...
 
RandomAccessSourceFactory  SetForceRead (bool forceRead)
  Determines whether the full content of the source will be read into memory More...
 
RandomAccessSourceFactory  SetUsePlainRandomAccess (bool usePlainRandomAccess)
  Determines whether System.IO.FileStream should be used as the primary data access mechanism More...
 
RandomAccessSourceFactory  SetExclusivelyLockFile (bool exclusivelyLockFile)
 
IRandomAccessSource  CreateSource (byte[] data)
  Creates a RandomAccessSource based on a byte array More...
 
IRandomAccessSource  CreateSource (FileStream raf)
 
Exceptions
System.IO.IOException

 
IRandomAccessSource  CreateSource (Uri url)
  Creates a RandomAccessSource based on a URL. The data available at the URL is read into memory and used as the source for the RandomAccessSource More...
 
IRandomAccessSource  CreateSource (Stream inputStream)
  Creates a RandomAccessSource based on an System.IO.Stream . The full content of the InputStream is read into memory and used as the source for the RandomAccessSource More...
 
IRandomAccessSource  CreateBestSource (String filename)
  Creates a RandomAccessSource based on a filename string. If the filename describes a URL, a URL based source is created If the filename describes a file on disk, the contents may be read into memory (if forceRead is true), opened using memory mapped file channel (if usePlainRandomAccess is false), or opened using System.IO.FileStream access (if usePlainRandomAccess is true) This call will automatically fail over to using System.IO.FileStream if the memory map operation fails More...
 
IRandomAccessSource  CreateRanged (IRandomAccessSource source, long[] ranges)
 
Exceptions
System.IO.IOException

 

Detailed Description

Factory to create RandomAccessSource objects based on various types of sources

Constructor & Destructor Documentation

◆ RandomAccessSourceFactory()

iText.IO.Source.RandomAccessSourceFactory.RandomAccessSourceFactory ( )
inline

Creates a factory that will give preference to accessing the underling data source using memory mapped files

Member Function Documentation

◆ CreateBestSource()

IRandomAccessSource iText.IO.Source.RandomAccessSourceFactory.CreateBestSource ( String  filename )
inline

Creates a RandomAccessSource based on a filename string. If the filename describes a URL, a URL based source is created If the filename describes a file on disk, the contents may be read into memory (if forceRead is true), opened using memory mapped file channel (if usePlainRandomAccess is false), or opened using System.IO.FileStream access (if usePlainRandomAccess is true) This call will automatically fail over to using System.IO.FileStream if the memory map operation fails

Parameters
filename the name of the file or resource to create the RandomAccessSource for
Returns
the newly created RandomAccessSource
Exceptions
System.IO.IOException

◆ CreateSource() [1/3]

IRandomAccessSource iText.IO.Source.RandomAccessSourceFactory.CreateSource ( byte[]  data )
inline

Creates a RandomAccessSource based on a byte array

Parameters
data the byte array
Returns
the newly created RandomAccessSource

◆ CreateSource() [2/3]

IRandomAccessSource iText.IO.Source.RandomAccessSourceFactory.CreateSource ( Stream  inputStream )
inline

Creates a RandomAccessSource based on an System.IO.Stream . The full content of the InputStream is read into memory and used as the source for the RandomAccessSource

Parameters
inputStream the stream to read from
Returns
the newly created RandomAccessSource
Exceptions
System.IO.IOException

◆ CreateSource() [3/3]

IRandomAccessSource iText.IO.Source.RandomAccessSourceFactory.CreateSource ( Uri  url )
inline

Creates a RandomAccessSource based on a URL. The data available at the URL is read into memory and used as the source for the RandomAccessSource

Parameters
url the url to read from
Returns
the newly created RandomAccessSource
Exceptions
System.IO.IOException

◆ SetForceRead()

RandomAccessSourceFactory iText.IO.Source.RandomAccessSourceFactory.SetForceRead ( bool  forceRead )
inline

Determines whether the full content of the source will be read into memory

Parameters
forceRead true if the full content will be read, false otherwise
Returns
this object (this allows chaining of method calls)

◆ SetUsePlainRandomAccess()

RandomAccessSourceFactory iText.IO.Source.RandomAccessSourceFactory.SetUsePlainRandomAccess ( bool  usePlainRandomAccess )
inline

Determines whether System.IO.FileStream should be used as the primary data access mechanism

Parameters
usePlainRandomAccess whether System.IO.FileStream should be used as the primary data access mechanism
Returns
this object (this allows chaining of method calls)