IOLink Python 1.11.0
Loading...
Searching...
No Matches
iolink.iolink.StreamAccessFactory Class Reference
Inheritance diagram for iolink.iolink.StreamAccessFactory:

Public Member Functions

 __init__ (self, *args, **kwargs)
 

Static Public Member Functions

 allocate (size=0)
 
 copy_in_memory (streamAccess)
 
 open_file_read (filePath)
 
 open_file_write (filePath)
 
 open_file (filePath)
 
 open_uri_write (uri)
 
 open_http_write (uri, method, headers)
 
 from_random_access (randomAccess)
 

Properties

 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 

Detailed Description

A factory to create StreamAccess instances from various ressources.

Member Function Documentation

◆ allocate()

iolink.iolink.StreamAccessFactory.allocate (   size = 0)
static
    Create a stream in local memory
    :type size: int, optional
    :param size: memory size (in byte) to allocate for the stream.
    :rtype: :py:class:`StreamAccess`
    :return: a MemoryStreamAccess with all capabilities (`read`, `write` and `seek`)

◆ copy_in_memory()

iolink.iolink.StreamAccessFactory.copy_in_memory (   streamAccess)
static
    Load a stream into local memory
    :type streamAccess: :py:class:`StreamAccess`
    :param streamAccess: stream with at least `read` capability to load in memory
    :rtype: :py:class:`StreamAccess`
    :return: a MemoryStreamAccess with all capabilities (`read`, `write` and `seek`)
    :raises: InvalidArgument if input streamAccess is null
    :raises: Error if the input streamAccess has no read or seek capability

◆ from_random_access()

iolink.iolink.StreamAccessFactory.from_random_access (   randomAccess)
static
    Create a StreamAccess that will delegate to a RandomAccess.
    :type randomAccess: :py:class:`RandomAccess`
    :param randomAccess: RandomAccess from which a StreamAccess is created
    :rtype: :py:class:`StreamAccess`
    :return: a StreamAccess object which can provide `read`, `write` and `seek` capability (see StreamAccessCapability)
    :raises: InvalidArgument if input randomAccess is null
    :raises: Error if the input randomAccess has nor read and write capability

◆ open_file()

iolink.iolink.StreamAccessFactory.open_file (   filePath)
static
    Create a stream that can read and write data from/to a file.
    :type filePath: string
    :param filePath: path toward the file which it's tried to access for reading and writing
    :rtype: :py:class:`StreamAccess`
    :return: a StreamAccess object which can provide `read`, `write` and eventually `seek` capability (see
        StreamAccessCapability)

◆ open_file_read()

iolink.iolink.StreamAccessFactory.open_file_read (   filePath)
static
    Create a stream that can read data from a file.
    :type filePath: string
    :param filePath: path toward the file which it's tried to access for reading
    :rtype: :py:class:`StreamAccess`
    :return: a StreamAccess object which can eventually provide `seek` capability (see StreamAccessCapability)

◆ open_file_write()

iolink.iolink.StreamAccessFactory.open_file_write (   filePath)
static
    Create a stream that can write data to a file.
    :type filePath: string
    :param filePath: path toward the file which it's tried to access for writing
    :rtype: :py:class:`StreamAccess`
    :return: a StreamAccess object which can eventually provide `seek` capability (see StreamAccessCapability)

◆ open_http_write()

iolink.iolink.StreamAccessFactory.open_http_write (   uri,
  method,
  headers 
)
static
    Create a stream that can post data to an HTTP URI.
    HTTP server must support chunked transfer encoding.

    :type uri: :py:class:`Uri`
    :param uri: The HTTP(S) URI to post to.
    :type method: string
    :param method: The HTTP request method.
    :type headers: :py:class:`HTTPHeaders`
    :param headers: The HTTP request headers.
    :rtype: :py:class:`StreamAccess`
    :return: a StreamAccess object which can eventually provide `seek` capability (see StreamAccessCapability)

◆ open_uri_write()

iolink.iolink.StreamAccessFactory.open_uri_write (   uri)
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.
    :type uri: :py:class:`Uri`
    :param uri: URI to open for writing
    :rtype: :py:class:`StreamAccess`
    :return: a StreamAccess object which can eventually provide `seek` capability (see StreamAccessCapability)

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