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

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

Inheritance diagram for IOLink.StreamAccessFactory:

Public Member Functions

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

Static Public Member Functions

static global::System.Runtime.InteropServices.HandleRef getCPtr (StreamAccessFactory obj)
 
static global::System.Runtime.InteropServices.HandleRef swigRelease (StreamAccessFactory obj)
 
static System.IO.Stream ToNetStream (StreamAccess storage)
 
static StreamAccess FromNetStream (System.IO.Stream stream)
 
static StreamAccess Allocate (uint size)
 Create a stream in local memory.
 
static StreamAccess Allocate ()
 Create a stream in local memory.
 
static StreamAccess CopyInMemory (StreamAccess streamAccess)
 Load a stream into local memory.
 
static StreamAccess OpenFileRead (string filePath)
 Create a stream that can read data from a file.
 
static StreamAccess OpenFileWrite (string filePath)
 Create a stream that can write data to a file.
 
static StreamAccess OpenFile (string filePath)
 Create a stream that can read and write data from/to a file.
 
static StreamAccess OpenURIWrite (Uri uri)
 Create a stream that can write data to an URI.
 
static StreamAccess OpenHTTPWrite (Uri uri, string method, HTTPHeaders headers)
 Create a stream that can post data to an HTTP URI. HTTP server must support chunked transfer encoding.
 
static StreamAccess FromRandomAccess (RandomAccess randomAccess)
 Create a StreamAccess that will delegate to a RandomAccess.
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Protected Attributes

bool swigCMemOwn
 

Detailed Description

A factory to create StreamAccess instances from various ressources.

Examples
SerializeArray.cs.

Member Function Documentation

◆ Allocate() [1/2]

static StreamAccess IOLink.StreamAccessFactory.Allocate ( )
inlinestatic

Create a stream in local memory.

Parameters
sizememory size (in byte) to allocate for the stream.
Returns
a MemoryStreamAccess with all capabilities (read, write and seek)

◆ Allocate() [2/2]

static StreamAccess IOLink.StreamAccessFactory.Allocate ( uint  size)
inlinestatic

Create a stream in local memory.

Parameters
sizememory size (in byte) to allocate for the stream.
Returns
a MemoryStreamAccess with all capabilities (read, write and seek)

◆ CopyInMemory()

static StreamAccess IOLink.StreamAccessFactory.CopyInMemory ( StreamAccess  streamAccess)
inlinestatic

Load a stream into local memory.

Parameters
streamAccessstream with at least read capability to load in memory
Returns
a MemoryStreamAccess with all capabilities (read, write and seek)
Exceptions
InvalidArgumentif input streamAccess is null
Errorif the input streamAccess has no read or seek capability

◆ FromRandomAccess()

static StreamAccess IOLink.StreamAccessFactory.FromRandomAccess ( RandomAccess  randomAccess)
inlinestatic

Create a StreamAccess that will delegate to a RandomAccess.

Parameters
randomAccessRandomAccess from which a StreamAccess is created
Returns
a StreamAccess object which can provide read, write and seek capability (see StreamAccessCapability)
Exceptions
InvalidArgumentif input randomAccess is null
Errorif the input randomAccess has nor read and write capability

◆ OpenFile()

static StreamAccess IOLink.StreamAccessFactory.OpenFile ( string  filePath)
inlinestatic

Create a stream that can read and write data from/to a file.

Parameters
filePathpath toward the file which it's tried to access for reading and writing
Returns
a StreamAccess object which can provide read, write and eventually seek capability (see StreamAccessCapability)

◆ OpenFileRead()

static StreamAccess IOLink.StreamAccessFactory.OpenFileRead ( string  filePath)
inlinestatic

Create a stream that can read data from a file.

Parameters
filePathpath toward the file which it's tried to access for reading
Returns
a StreamAccess object which can eventually provide seek capability (see StreamAccessCapability)
Examples
SerializeArray.cs.

◆ OpenFileWrite()

static StreamAccess IOLink.StreamAccessFactory.OpenFileWrite ( string  filePath)
inlinestatic

Create a stream that can write data to a file.

Parameters
filePathpath toward the file which it's tried to access for writing
Returns
a StreamAccess object which can eventually provide seek capability (see StreamAccessCapability)
Examples
SerializeArray.cs.

◆ OpenHTTPWrite()

static StreamAccess IOLink.StreamAccessFactory.OpenHTTPWrite ( Uri  uri,
string  method,
HTTPHeaders  headers 
)
inlinestatic

Create a stream that can post data to an HTTP URI. HTTP server must support chunked transfer encoding.

Parameters
uriThe HTTP(S) URI to post to.
methodThe HTTP request method.
headersThe HTTP request headers.
Returns
a StreamAccess object which can eventually provide seek capability (see StreamAccessCapability)

◆ OpenURIWrite()

static StreamAccess IOLink.StreamAccessFactory.OpenURIWrite ( Uri  uri)
inlinestatic

Create a stream that can write data to an URI.

If the URI scheme is 'file': calls openFileWrite. If the URI scheme is 'http(s)': calls openHTTPWrite, using the POST method and no headers.

Parameters
uriURI to open for writing
Returns
a StreamAccess object which can eventually provide seek capability (see StreamAccessCapability)

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