IOLink C# 1.11.0
Loading...
Searching...
No Matches
IOLink.RandomAccessFactory Class Reference

A factory to create RandomAccess instances from various ressources. More...

Inheritance diagram for IOLink.RandomAccessFactory:

Public Member Functions

 RandomAccessFactory (global::System.IntPtr cPtr, bool cMemoryOwn)
 
void Dispose ()
 

Static Public Member Functions

static global::System.Runtime.InteropServices.HandleRef getCPtr (RandomAccessFactory obj)
 
static global::System.Runtime.InteropServices.HandleRef swigRelease (RandomAccessFactory obj)
 
static RandomAccess Allocate (uint size)
 Create an in-memory RandomAccess of given size.
 
static RandomAccess CopyInMemory (RandomAccess randomAccess)
 Load given RandomAccess in memory. If storage is already an in-memory RandomAccess, return it (no copy are done).
 
static RandomAccess MapFile (string filePath)
 Get an accessor from a file mapped in memory.
 
static unsafe RandomAccess FromBuffer (byte[] buffer, uint size)
 Create a RandomAccess from given memory area.
 
static RandomAccess OpenURIRead (Uri uri)
 Create a RandomAccess from given URI, opening URI in Read Only.
 
static RandomAccess OpenHTTPRead (Uri uri, string method, HTTPHeaders headers)
 Create a RandomAccess from given HTTP URI, opening URI in Read Only. Requested HTTP server must support HTTP range requests.
 
static RandomAccess ExtractRegion (RandomAccess src, uint offset)
 Creates an accessor to a subset of a RandomAccess.
 
static RandomAccess ExtractRegion (RandomAccess src, uint offset, uint size)
 Creates an accessor to a subset of a RandomAccess.
 
static RandomAccess FromStream (StreamAccess stream)
 Create a RandomAccess that will delegate to a StreamAccess.
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Protected Attributes

bool swigCMemOwn
 

Detailed Description

A factory to create RandomAccess instances from various ressources.

Member Function Documentation

◆ CopyInMemory()

static RandomAccess IOLink.RandomAccessFactory.CopyInMemory ( RandomAccess  randomAccess)
inlinestatic

Load given RandomAccess in memory. If storage is already an in-memory RandomAccess, return it (no copy are done).

Exceptions
InvalidArgumentif input randomAccess is null

◆ ExtractRegion() [1/2]

static RandomAccess IOLink.RandomAccessFactory.ExtractRegion ( RandomAccess  src,
uint  offset 
)
inlinestatic

Creates an accessor to a subset of a RandomAccess.

Parameters
srcThe accessor to create the subset from
offsetThe offset from the start of the source accessor
Exceptions
InvalidArgumentif input randomAccess is null
ErrorWhen offset is out of range.

◆ ExtractRegion() [2/2]

static RandomAccess IOLink.RandomAccessFactory.ExtractRegion ( RandomAccess  src,
uint  offset,
uint  size 
)
inlinestatic

Creates an accessor to a subset of a RandomAccess.

Parameters
srcThe accessor to create the subset from
offsetThe offset from the start of the source accessor
sizeThe size of the subset.
Exceptions
InvalidArgumentif input randomAccess is null
ErrorWhen the subset range is out of the source accessor range.

◆ FromBuffer()

static unsafe RandomAccess IOLink.RandomAccessFactory.FromBuffer ( byte[]  buffer,
uint  size 
)
inlinestatic

Create a RandomAccess from given memory area.

The return DataAccess does not have the ownership of given buffer. You must carefully manage lifetime of each objects.

◆ FromStream()

static RandomAccess IOLink.RandomAccessFactory.FromStream ( StreamAccess  stream)
inlinestatic

Create a RandomAccess that will delegate to a StreamAccess.

Exceptions
InvalidArgumentif input stream is null

◆ MapFile()

static RandomAccess IOLink.RandomAccessFactory.MapFile ( string  filePath)
inlinestatic

Get an accessor from a file mapped in memory.

Parameters
filePathThe path to the file to map.
Returns
A RandomAccess with read and write capabilities.
Exceptions
ErrorIf the file does not exist already

◆ OpenHTTPRead()

static RandomAccess IOLink.RandomAccessFactory.OpenHTTPRead ( Uri  uri,
string  method,
HTTPHeaders  headers 
)
inlinestatic

Create a RandomAccess from given HTTP URI, opening URI in Read Only. Requested HTTP server must support HTTP range requests.

Parameters
uriThe HTTP(S) URI to get.
methodThe HTTP request method.
headersThe HTTP request headers.

◆ OpenURIRead()

static RandomAccess IOLink.RandomAccessFactory.OpenURIRead ( Uri  uri)
inlinestatic

Create a RandomAccess from given URI, opening URI in Read Only.

If the URI scheme is 'file': creates a ReadRandomAccess using StreamAccessFactory::openFileRead(). If the URI scheme is 'http(s)': calls openHTTPRead(), using the GET method and no headers.


The documentation for this class was generated from the following file: