IOLink C# 1.11.0
Loading...
Searching...
No Matches
IOLink.NetStreamAccess Class Reference
Inheritance diagram for IOLink.NetStreamAccess:
IOLink.StreamAccess IOLink.DataAccess

Public Member Functions

 NetStreamAccess (System.IO.Stream stream)
 
override 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.
 
override bool GetEof ()
 Checks if the cursor is at the end of the stream for reading For writing, this status is not relevant.
 
override string GetResourceId ()
 Return the resource identifier of this data accessor.
 
override DataStorage GetStorage ()
 Get the storage to which this data accessor belong.
 
override StreamAccessCapabilitySet GetCapabilities ()
 
Returns
capabilities for current stream

 
override 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.
 
override uint Write (uint size, byte[] src)
 Write content of src buffer into StreamAccess. Stream cursor is incremented by actually written bytes count.
 
override void Flush ()
 Assure that all data is written to the endpoint.
 
override byte Peek ()
 Return the current byte without moving the cursor.
 
override uint Tell ()
 Returns the current position of the cursor.
 
override void Seek (long offset, SeekOrigin origin)
 Move the cursor to the desired position.
 

Additional Inherited Members

Member Function Documentation

◆ Flush()

override void IOLink.NetStreamAccess.Flush ( )
inlinevirtual

Assure that all data is written to the endpoint.

Available when the StreamAccess has the WRITE capability.

Reimplemented from IOLink.StreamAccess.

◆ GetCapabilities()

override StreamAccessCapabilitySet IOLink.NetStreamAccess.GetCapabilities ( )
inlinevirtual

Returns
capabilities for current stream

Reimplemented from IOLink.StreamAccess.

◆ GetEof()

override bool IOLink.NetStreamAccess.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 from IOLink.StreamAccess.

◆ GetGood()

override bool IOLink.NetStreamAccess.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 from IOLink.StreamAccess.

◆ GetResourceId()

override string IOLink.NetStreamAccess.GetResourceId ( )
inlinevirtual

Return the resource identifier of this data accessor.

Reimplemented from IOLink.DataAccess.

◆ GetStorage()

override DataStorage IOLink.NetStreamAccess.GetStorage ( )
inlinevirtual

Get the storage to which this data accessor belong.

Reimplemented from IOLink.DataAccess.

◆ Peek()

override byte IOLink.NetStreamAccess.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 from IOLink.StreamAccess.

◆ Read()

override uint IOLink.NetStreamAccess.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 from IOLink.StreamAccess.

◆ Seek()

override void IOLink.NetStreamAccess.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 from IOLink.StreamAccess.

◆ Tell()

override uint IOLink.NetStreamAccess.Tell ( )
inlinevirtual

Returns the current position of the cursor.

Available when the StreamAccess has the SEEK capability.

Reimplemented from IOLink.StreamAccess.

◆ Write()

override uint IOLink.NetStreamAccess.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 from IOLink.StreamAccess.


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