| IOLink C# 1.11.0

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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 | ( |  | ) |
| inline static

Create a stream in local memory.

Parameters

  size | memory 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 | ) |
| inline static

Create a stream in local memory.

Parameters

  size | memory 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 | ) |
| inline static

Load a stream into local memory.

Parameters

  streamAccess | stream with at least `read` capability to load in memory

Returns
  a MemoryStreamAccess with all capabilities (`read`, `write` and `seek`)

Exceptions

  InvalidArgument | if input streamAccess is null
  Error | if the input streamAccess has no read or seek capability

## ◆ FromRandomAccess()

static StreamAccess IOLink.StreamAccessFactory.FromRandomAccess | ( | RandomAccess | randomAccess | ) |
| inline static

Create a StreamAccess that will delegate to a RandomAccess.

Parameters

  randomAccess | RandomAccess from which a StreamAccess is created

Returns
  a StreamAccess object which can provide `read`, `write` and `seek` capability (see StreamAccessCapability)

Exceptions

  InvalidArgument | if input randomAccess is null
  Error | if the input randomAccess has nor read and write capability

## ◆ OpenFile()

static StreamAccess IOLink.StreamAccessFactory.OpenFile | ( | string | filePath | ) |
| inline static

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

Parameters

  filePath | path 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 | ) |
| inline static

Create a stream that can read data from a file.

Parameters

  filePath | path 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 | ) |
| inline static

Create a stream that can write data to a file.

Parameters

  filePath | path 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
| ) |  |
| inline static

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

Parameters

  uri | The HTTP(S) URI to post to.
  method | The HTTP request method.
  headers | The HTTP request headers.

Returns
  a StreamAccess object which can eventually provide `seek` capability (see StreamAccessCapability)

## ◆ OpenURIWrite()

static StreamAccess IOLink.StreamAccessFactory.OpenURIWrite | ( | Uri | uri | ) |
| inline static

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

  uri | URI 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:

- Release/net/generated/StreamAccessFactory.cs