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

Mother interface for all stream-like data accessors. More...

Inheritance diagram for IOLink.StreamAccess:
IOLink.DataAccess IOLink.NetStreamAccess

Public Member Functions

 StreamAccess (global::System.IntPtr cPtr, bool cMemoryOwn)
 
virtual StreamAccessCapabilitySet GetCapabilities ()
 
Returns
capabilities for current stream

 
bool Support (StreamAccessCapabilitySet flags)
 Checks if the StreamAccess supports the given capabilities.
 
virtual bool GetGood ()
 Checks if the stream is currently valid for reading (only) Default implementation returns true if nor 'end of file' or 'fail' status are raised.
 
virtual bool GetEof ()
 Checks if the cursor is at the end of the stream for reading For writing, this status is not relevant.
 
virtual bool GetFail ()
 
string ToString ()
 Return a string representation.
 
virtual unsafe uint Read (uint size, byte[] dst)
 Read data from cursor current position into destination buffer. Cursor position is incremented by the actually read bytes count.
 
virtual byte Peek ()
 Return the current byte without moving the cursor.
 
virtual unsafe uint Write (uint size, byte[] src)
 Write content of src buffer into StreamAccess. Stream cursor is incremented by actually written bytes count.
 
virtual void Flush ()
 Assure that all data is written to the endpoint.
 
virtual uint Tell ()
 Returns the current position of the cursor.
 
virtual void Seek (long offset, SeekOrigin origin)
 Move the cursor to the desired position.
 
delegate global::System.IntPtr SwigDelegateStreamAccess_0 ()
 
delegate string SwigDelegateStreamAccess_1 ()
 
delegate global::System.IntPtr SwigDelegateStreamAccess_2 ()
 
delegate bool SwigDelegateStreamAccess_3 ()
 
delegate bool SwigDelegateStreamAccess_4 ()
 
delegate bool SwigDelegateStreamAccess_5 ()
 
delegate uint SwigDelegateStreamAccess_6 (uint size, global::System.IntPtr dst)
 
delegate byte SwigDelegateStreamAccess_7 ()
 
delegate uint SwigDelegateStreamAccess_8 (uint size, global::System.IntPtr src)
 
delegate void SwigDelegateStreamAccess_9 ()
 
delegate uint SwigDelegateStreamAccess_10 ()
 
delegate void SwigDelegateStreamAccess_11 (long offset, int origin)
 

Static Public Member Functions

static global::System.Runtime.InteropServices.HandleRef getCPtr (StreamAccess obj)
 

Protected Member Functions

override void Dispose (bool disposing)
 

Properties

StreamAccessCapabilitySet Capabilities [get]
 The Capabilities on the StreamAccess
 
bool IsGood [get]
 Checks if the stream is in a good state.
 
bool IsEof [get]
 Checks if the stream at the end of file.
 
bool IsFail [get]
 Checks if the stream is in a fail state.
 

Detailed Description

Mother interface for all stream-like data accessors.

This interface capabilities are indicated by the StreamAccessCapabilitySet returned by the method StreamAccess::capabilities. Each capability enables the use of a specific set of methods. When one of those methods is called, if its corresponding capability is not supported, a NotImplemented exception will be thrown.

Examples
SerializeArray.cs.

Member Function Documentation

◆ Dispose()

override void IOLink.StreamAccess.Dispose ( bool  disposing)
inlineprotectedvirtual

Reimplemented from IOLink.DataAccess.

◆ Flush()

virtual void IOLink.StreamAccess.Flush ( )
inlinevirtual

Assure that all data is written to the endpoint.

Available when the StreamAccess has the WRITE capability.

Reimplemented in IOLink.NetStreamAccess.

Examples
SerializeArray.cs.

◆ GetCapabilities()

virtual StreamAccessCapabilitySet IOLink.StreamAccess.GetCapabilities ( )
inlinevirtual

Returns
capabilities for current stream

Reimplemented in IOLink.NetStreamAccess.

◆ GetEof()

virtual bool IOLink.StreamAccess.GetEof ( )
inlinevirtual

Checks if the cursor is at the end of the stream for reading For writing, this status is not relevant.

Returns
true if the end of stream is reached. No more byte can be read.

Reimplemented in IOLink.NetStreamAccess.

◆ GetGood()

virtual bool IOLink.StreamAccess.GetGood ( )
inlinevirtual

Checks if the stream is currently valid for reading (only) Default implementation returns true if nor 'end of file' or 'fail' status are raised.

Returns
true if the stream can be read

Reimplemented in IOLink.NetStreamAccess.

◆ Peek()

virtual byte IOLink.StreamAccess.Peek ( )
inlinevirtual

Return the current byte without moving the cursor.

Available when the StreamAccess has the READ capability.

Exceptions
Errorif cursor is at EOF.

Reimplemented in IOLink.NetStreamAccess.

◆ Read()

virtual unsafe uint IOLink.StreamAccess.Read ( uint  size,
byte[]  dst 
)
inlinevirtual

Read data from cursor current position into destination buffer. Cursor position is incremented by the actually read bytes count.

Available when the StreamAccess has the READ capability.

Parameters
sizeSize in byte of the area to read
dstDestination buffer. This buffer should have a size of "size"
Returns
Count of actually read bytes.

Reimplemented in IOLink.NetStreamAccess.

◆ Seek()

virtual void IOLink.StreamAccess.Seek ( long  offset,
SeekOrigin  origin 
)
inlinevirtual

Move the cursor to the desired position.

Available when the StreamAccess has the SEEK capability.

Cursor position must be set as following: new position = current position + offset If new computed position is less than 0, previous current position is kept.

Parameters
offsetOffset used to move the cursor according to the origin.
originThe origin from which to move the cursor. Can be the start of the stream, the current position of the cursor, or the end of the stream. Positive offsets always make the cursor move forward in the stream, whatever the origin. Negative offsets always make the cursor move backward.
Exceptions
Errorif trying to set cursor before BEGIN position (negative value)

Reimplemented in IOLink.NetStreamAccess.

◆ Tell()

virtual uint IOLink.StreamAccess.Tell ( )
inlinevirtual

Returns the current position of the cursor.

Available when the StreamAccess has the SEEK capability.

Reimplemented in IOLink.NetStreamAccess.

◆ Write()

virtual unsafe uint IOLink.StreamAccess.Write ( uint  size,
byte[]  src 
)
inlinevirtual

Write content of src buffer into StreamAccess. Stream cursor is incremented by actually written bytes count.

Available when the StreamAccess has the WRITE capability.

Parameters
sizeSize in byte of given buffer to write
srcSource buffer. This buffer should have a size of "size"
Returns
Count of actually written bytes. It may not be considered as an error that return value if different than size (ie. an exception may not be thrown). It is up to user to decide what to do in this case.

Reimplemented in IOLink.NetStreamAccess.


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