Skip to content

Reference

OpcNodeStream Members

Provides a Stream for a binary variable node.

Reference

OpcNodeStream Members ​

Type
OpcNodeStream
Namespace
Opc.UaFx.Client
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Also in
Opc.UaFx.Client

Inherits members from Stream, MarshalByRefObject.

Constructors ​

OpcNodeStream ​

3 overloads

OverloadDescription
OpcNodeStream(OpcVariableNodeInfo)Initializes a new instance of the OpcNodeStream class using the specified node.
OpcNodeStream(OpcNodeAccessContext)Initializes a new instance of the OpcNodeStream class using the specified context.
OpcNodeStream(OpcClient, OpcNodeId)Initializes a new instance of the OpcNodeStream class using the specified client and nodeId.

OpcNodeStream(OpcVariableNodeInfo) ​

Initializes a new instance of the OpcNodeStream class using the specified node.

csharp
public OpcNodeStream(OpcVariableNodeInfo node)
vbnet
Public Sub New(node As OpcVariableNodeInfo)

Parameters

NameTypeDescription
nodeOpcVariableNodeInfoThe OpcVariableNodeInfo of the binary variable node to access.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe node is a null reference (Nothing in Visual Basic).

OpcNodeStream(OpcNodeAccessContext) ​

Initializes a new instance of the OpcNodeStream class using the specified context.

csharp
public OpcNodeStream(OpcNodeAccessContext context)
vbnet
Public Sub New(context As OpcNodeAccessContext)

Parameters

NameTypeDescription
contextOpcNodeAccessContextThe OpcNodeAccessContext of the binary variable node to access.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe context is a null reference (Nothing in Visual Basic).

OpcNodeStream(OpcClient, OpcNodeId) ​

Initializes a new instance of the OpcNodeStream class using the specified client and nodeId.

csharp
public OpcNodeStream(OpcClient client, OpcNodeId nodeId)
vbnet
Public Sub New(client As OpcClient, nodeId As OpcNodeId)

Parameters

NameTypeDescription
clientOpcClientThe OpcClient to use to access the binary variable node.
nodeIdOpcNodeIdThe OpcNodeId of the binary variable node to access.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe client or nodeId is a null reference (Nothing in Visual Basic).

Properties ​

CanRead ​

override

Gets a value indicating whether the current stream supports reading.

csharp
public override bool CanRead { get; }
vbnet
Public Overrides ReadOnly Property CanRead As Boolean

Property value

Boolean

The value true if the stream supports reading; otherwise the value false.

Overrides

CanRead

Remarks

If the stream is closed, this property returns false.

CanSeek ​

override

Gets a value indicating whether the current stream supports seeking.

csharp
public override bool CanSeek { get; }
vbnet
Public Overrides ReadOnly Property CanSeek As Boolean

Property value

Boolean

The value true if the stream supports seeking; otherwise the value false.

Overrides

CanSeek

Remarks

If the stream is closed, this property returns false.

CanWrite ​

override

Gets a value indicating whether the current stream supports writing.

csharp
public override bool CanWrite { get; }
vbnet
Public Overrides ReadOnly Property CanWrite As Boolean

Property value

Boolean

The value true if the stream supports writing; otherwise the value false.

Overrides

CanWrite

Remarks

If the stream is closed, this property returns false.

Length ​

override

Gets the length in bytes of the stream.

csharp
public override long Length { get; }
vbnet
Public Overrides ReadOnly Property Length As Long

Property value

Int64

A long value representing the length of the stream in bytes.

Exceptions

ExceptionCondition
ObjectDisposedExceptionThe stream has been disposed of.

Overrides

Length

Node ​

Gets the node whose value the stream accesses.

csharp
public OpcVariableNodeInfo Node { get; }
vbnet
Public ReadOnly Property Node As OpcVariableNodeInfo

Property value

OpcVariableNodeInfo

The OpcVariableNodeInfo of the binary variable node.

Position ​

override

Gets or sets the position within the current stream.

csharp
public override long Position { get; set; }
vbnet
Public Overrides Property Position As Long

Property value

Int64

The current position within the stream.

Exceptions

ExceptionCondition
ObjectDisposedExceptionThe stream has been disposed of.

Overrides

Position

Methods ​

Close ​

override

Closes the current stream and releases any resources associated with the current stream. Instead of calling this method, ensure that the stream is properly disposed.

csharp
public override sealed void Close()
vbnet
Public NotOverridable Overrides Sub Close()

Overrides

Close()

Remarks

Attempts to manipulate the stream after the stream has been closed might throw an ObjectDisposedException.

Flush ​

override

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.

csharp
public override void Flush()
vbnet
Public Overrides Sub Flush()

Overrides

Flush()

Read ​

override

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

csharp
public override int Read(byte[] buffer, int offset, int count)
vbnet
Public Overrides Function Read(
    buffer As Byte(),
    offset As Integer,
    count As Integer) As Integer

Parameters

NameTypeDescription
bufferByte[]An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.
offsetInt32The zero-based byte offset in buffer at which to begin storing the data read from the current stream.
countInt32The maximum number of bytes to be read from the current stream.

Returns

Int32

The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.

Exceptions

ExceptionCondition
ArgumentExceptionThe sum of offset and count is larger than the buffer length.
ArgumentNullExceptionThe buffer is a null reference (Nothing in Visual Basic).
ArgumentOutOfRangeExceptionThe offset or count is negative.
NotSupportedExceptionThe stream does not support reading.
ObjectDisposedExceptionThe stream has been disposed of.

Overrides

Read(byte[], int, int)

Remarks

Use the CanRead property to determine whether the current instance supports reading.

Seek ​

override

Sets the position within the current stream.

csharp
public override long Seek(long offset, SeekOrigin origin)
vbnet
Public Overrides Function Seek(offset As Long, origin As SeekOrigin) As Long

Parameters

NameTypeDescription
offsetInt64A byte offset relative to the origin parameter.
originSeekOriginA value of type SeekOrigin indicating the reference point used to obtain the new position.

Returns

Int64

The new position within the current stream.

Exceptions

ExceptionCondition
NotSupportedExceptionThe stream does not support seeking.
ObjectDisposedExceptionThe stream has been disposed of.

Overrides

Seek(long, SeekOrigin)

Remarks

Use the CanSeek property to determine whether the current instance supports seeking. Seeking to any location beyond the length of the stream is supported.

SetLength ​

override

Sets the length of the current stream.

csharp
public override void SetLength(long value)
vbnet
Public Overrides Sub SetLength(value As Long)

Parameters

NameTypeDescription
valueInt64The desired length of the current stream in bytes.

Exceptions

ExceptionCondition
ObjectDisposedExceptionThe stream has been disposed of.
NotSupportedExceptionThe stream does not support both writing and seeking.

Overrides

SetLength(long)

Remarks

Use the CanWrite property to determine whether the current instance supports writing, and the CanSeek property to determine whether seeking is supported. If the specified value is less than the current length of the stream, the stream is truncated. If the specified value is larger than the current length of the stream, the stream is expanded. If the stream is expanded, the contents of the stream between the old and the new length are not defined.

Write ​

override

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

csharp
public override void Write(byte[] buffer, int offset, int count)
vbnet
Public Overrides Sub Write(
    buffer As Byte(),
    offset As Integer,
    count As Integer)

Parameters

NameTypeDescription
bufferByte[]An array of bytes. This method copies count bytes from buffer to the current stream.
offsetInt32The zero-based byte offset in buffer at which to begin copying bytes to the current stream.
countInt32The number of bytes to be written to the current stream.

Exceptions

ExceptionCondition
ArgumentExceptionThe sum of offset and count is larger than the buffer length.
ArgumentNullExceptionThe buffer is a null reference (Nothing in Visual Basic).
ArgumentOutOfRangeExceptionThe offset or count is negative.
NotSupportedExceptionThe stream does not support writing.
ObjectDisposedExceptionThe stream has been disposed of.

Overrides

Write(byte[], int, int)

Remarks

Use the CanWrite property to determine whether the current instance supports writing.