C# Class Opc.Ua.BinaryDecoder

Decodes objects from a UA Binary encoded stream.
Inheritance: IDecoder, IDisposable
Mostra file Open project: OPCFoundation/UA-.NET Class Usage Examples

Public Methods

Method Description
BinaryDecoder ( Stream stream, ServiceMessageContext context ) : System

Creates a decoder that reads from a stream.

BinaryDecoder ( byte buffer, ServiceMessageContext context ) : System

Creates a decoder that reads from a memory buffer.

BinaryDecoder ( byte buffer, int start, int count, ServiceMessageContext context ) : System

Creates a decoder that reads from a memory buffer.

Close ( ) : void

Completes reading and closes the stream.

DecodeMessage ( Stream stream, System expectedType, ServiceMessageContext context ) : IEncodeable

Decodes a message from a stream.

DecodeMessage ( System expectedType ) : IEncodeable

Decodes an object from a buffer.

DecodeMessage ( byte buffer, System expectedType, ServiceMessageContext context ) : IEncodeable

Decodes a message from a buffer.

Dispose ( ) : void

Frees any unmanaged resources.

LoadStringTable ( StringTable stringTable ) : bool

Loads a string table from a binary stream.

PopNamespace ( ) : void

Pops a namespace from the namespace stack.

PushNamespace ( string namespaceUri ) : void

Pushes a namespace onto the namespace stack.

ReadBoolean ( string fieldName ) : bool

Reads a boolean from the stream.

ReadBooleanArray ( string fieldName ) : BooleanCollection

Reads a boolean array from the stream.

ReadByte ( string fieldName ) : byte

Reads a byte from the stream.

ReadByteArray ( string fieldName ) : ByteCollection

Reads a byte array from the stream.

ReadByteString ( string fieldName ) : byte[]

Reads a byte string from the stream.

ReadByteString ( string fieldName, int maxByteStringLength ) : byte[]

Reads a byte string from the stream.

ReadByteStringArray ( string fieldName ) : ByteStringCollection

Reads a byte string array from the stream.

ReadDataValue ( string fieldName ) : Opc.Ua.DataValue

Reads an DataValue from the stream.

ReadDataValueArray ( string fieldName ) : DataValueCollection

Reads an DataValue array from the stream.

ReadDateTime ( string fieldName ) : System.DateTime

Reads a UTC date/time from the stream.

ReadDateTimeArray ( string fieldName ) : DateTimeCollection

Reads a UTC date/time array from the stream.

ReadDiagnosticInfo ( string fieldName ) : DiagnosticInfo

Reads an DiagnosticInfo from the stream.

ReadDiagnosticInfoArray ( string fieldName ) : DiagnosticInfoCollection

Reads an DiagnosticInfo array from the stream.

ReadDouble ( string fieldName ) : double

Reads a double from the stream.

ReadDoubleArray ( string fieldName ) : DoubleCollection

Reads a double array from the stream.

ReadEncodeable ( string fieldName, System systemType ) : IEncodeable

Reads an encodeable object from the stream.

ReadEncodeableArray ( string fieldName, System systemType ) : Array

Reads an encodeable object array from the stream.

ReadEnumerated ( string fieldName, System enumType ) : Enum

Reads an enumerated value from the stream.

ReadEnumeratedArray ( string fieldName, System enumType ) : Array

Reads an enumerated value array from the stream.

ReadExpandedNodeId ( string fieldName ) : Opc.Ua.ExpandedNodeId

Reads an ExpandedNodeId from the stream.

ReadExpandedNodeIdArray ( string fieldName ) : ExpandedNodeIdCollection

Reads an ExpandedNodeId array from the stream.

ReadExtensionObject ( string fieldName ) : Opc.Ua.ExtensionObject

Reads an ExtensionObject from the stream.

ReadExtensionObjectArray ( string fieldName ) : ExtensionObjectCollection

Reads an extension object array from the stream.

ReadFloat ( string fieldName ) : float

Reads a float from the stream.

ReadFloatArray ( string fieldName ) : FloatCollection

Reads a float array from the stream.

ReadGuid ( string fieldName ) : Uuid

Reads a GUID from the stream.

ReadGuidArray ( string fieldName ) : UuidCollection

Reads a GUID array from the stream.

ReadInt16 ( string fieldName ) : short

Reads a short from the stream.

ReadInt16Array ( string fieldName ) : Int16Collection

Reads a short array from the stream.

ReadInt32 ( string fieldName ) : int

Reads an int from the stream.

ReadInt32Array ( string fieldName ) : Int32Collection

Reads a int array from the stream.

ReadInt64 ( string fieldName ) : long

Reads a long from the stream.

ReadInt64Array ( string fieldName ) : Int64Collection

Reads a long array from the stream.

ReadLocalizedText ( string fieldName ) : Opc.Ua.LocalizedText

Reads an LocalizedText from the stream.

ReadLocalizedTextArray ( string fieldName ) : LocalizedTextCollection

Reads an LocalizedText array from the stream.

ReadNodeId ( string fieldName ) : Opc.Ua.NodeId

Reads an NodeId from the stream.

ReadNodeIdArray ( string fieldName ) : NodeIdCollection

Reads an NodeId array from the stream.

ReadQualifiedName ( string fieldName ) : Opc.Ua.QualifiedName

Reads an QualifiedName from the stream.

ReadQualifiedNameArray ( string fieldName ) : QualifiedNameCollection

Reads an QualifiedName array from the stream.

ReadSByte ( string fieldName ) : sbyte

Reads a sbyte from the stream.

ReadSByteArray ( string fieldName ) : SByteCollection

Reads a sbyte array from the stream.

ReadStatusCode ( string fieldName ) : Opc.Ua.StatusCode

Reads an StatusCode from the stream.

ReadStatusCodeArray ( string fieldName ) : StatusCodeCollection

Reads an StatusCode array from the stream.

ReadString ( string fieldName ) : string

Reads a string from the stream.

ReadString ( string fieldName, int maxStringLength ) : string

Reads a string from the stream (throws an exception if its length exceeds the limit specified).

ReadStringArray ( string fieldName ) : StringCollection

Reads a string array from the stream.

ReadUInt16 ( string fieldName ) : ushort

Reads a ushort from the stream.

ReadUInt16Array ( string fieldName ) : UInt16Collection

Reads a ushort array from the stream.

ReadUInt32 ( string fieldName ) : uint

Reads a uint from the stream.

ReadUInt32Array ( string fieldName ) : UInt32Collection

Reads a uint array from the stream.

ReadUInt64 ( string fieldName ) : ulong

Reads a ulong from the stream.

ReadUInt64Array ( string fieldName ) : UInt64Collection

Reads a ulong array from the stream.

ReadVariantArray ( string fieldName ) : VariantCollection

Reads an Variant array from the stream.

ReadXmlElement ( string fieldName ) : XmlElement

Reads an XmlElement from the stream.

ReadXmlElementArray ( string fieldName ) : XmlElementCollection

Reads an XmlElement array from the stream.

SetMappingTables ( Opc.Ua.NamespaceTable namespaceUris, StringTable serverUris ) : void

Initializes the tables used to map namespace and server uris during decoding.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

An overrideable version of the Dispose.

Private Methods

Method Description
ReadArrayLength ( ) : int

Reads the length of an array.

ReadExtensionObject ( ) : Opc.Ua.ExtensionObject

Reads an extension object from the stream.

ReadNodeIdBody ( byte encodingByte, Opc.Ua.NodeId value ) : void

Reads the body of a node id.

ReadVariant ( string fieldName ) : Variant

Method Details

BinaryDecoder() public method

Creates a decoder that reads from a stream.
public BinaryDecoder ( Stream stream, ServiceMessageContext context ) : System
stream Stream
context ServiceMessageContext
return System

BinaryDecoder() public method

Creates a decoder that reads from a memory buffer.
public BinaryDecoder ( byte buffer, ServiceMessageContext context ) : System
buffer byte
context ServiceMessageContext
return System

BinaryDecoder() public method

Creates a decoder that reads from a memory buffer.
public BinaryDecoder ( byte buffer, int start, int count, ServiceMessageContext context ) : System
buffer byte
start int
count int
context ServiceMessageContext
return System

Close() public method

Completes reading and closes the stream.
public Close ( ) : void
return void

DecodeMessage() public static method

Decodes a message from a stream.
public static DecodeMessage ( Stream stream, System expectedType, ServiceMessageContext context ) : IEncodeable
stream Stream
expectedType System
context ServiceMessageContext
return IEncodeable

DecodeMessage() public method

Decodes an object from a buffer.
public DecodeMessage ( System expectedType ) : IEncodeable
expectedType System
return IEncodeable

DecodeMessage() public static method

Decodes a message from a buffer.
public static DecodeMessage ( byte buffer, System expectedType, ServiceMessageContext context ) : IEncodeable
buffer byte
expectedType System
context ServiceMessageContext
return IEncodeable

Dispose() public method

Frees any unmanaged resources.
public Dispose ( ) : void
return void

Dispose() protected method

An overrideable version of the Dispose.
protected Dispose ( bool disposing ) : void
disposing bool
return void

LoadStringTable() public method

Loads a string table from a binary stream.
public LoadStringTable ( StringTable stringTable ) : bool
stringTable StringTable
return bool

PopNamespace() public method

Pops a namespace from the namespace stack.
public PopNamespace ( ) : void
return void

PushNamespace() public method

Pushes a namespace onto the namespace stack.
public PushNamespace ( string namespaceUri ) : void
namespaceUri string
return void

ReadBoolean() public method

Reads a boolean from the stream.
public ReadBoolean ( string fieldName ) : bool
fieldName string
return bool

ReadBooleanArray() public method

Reads a boolean array from the stream.
public ReadBooleanArray ( string fieldName ) : BooleanCollection
fieldName string
return BooleanCollection

ReadByte() public method

Reads a byte from the stream.
public ReadByte ( string fieldName ) : byte
fieldName string
return byte

ReadByteArray() public method

Reads a byte array from the stream.
public ReadByteArray ( string fieldName ) : ByteCollection
fieldName string
return ByteCollection

ReadByteString() public method

Reads a byte string from the stream.
public ReadByteString ( string fieldName ) : byte[]
fieldName string
return byte[]

ReadByteString() public method

Reads a byte string from the stream.
public ReadByteString ( string fieldName, int maxByteStringLength ) : byte[]
fieldName string
maxByteStringLength int
return byte[]

ReadByteStringArray() public method

Reads a byte string array from the stream.
public ReadByteStringArray ( string fieldName ) : ByteStringCollection
fieldName string
return ByteStringCollection

ReadDataValue() public method

Reads an DataValue from the stream.
public ReadDataValue ( string fieldName ) : Opc.Ua.DataValue
fieldName string
return Opc.Ua.DataValue

ReadDataValueArray() public method

Reads an DataValue array from the stream.
public ReadDataValueArray ( string fieldName ) : DataValueCollection
fieldName string
return DataValueCollection

ReadDateTime() public method

Reads a UTC date/time from the stream.
public ReadDateTime ( string fieldName ) : System.DateTime
fieldName string
return System.DateTime

ReadDateTimeArray() public method

Reads a UTC date/time array from the stream.
public ReadDateTimeArray ( string fieldName ) : DateTimeCollection
fieldName string
return DateTimeCollection

ReadDiagnosticInfo() public method

Reads an DiagnosticInfo from the stream.
public ReadDiagnosticInfo ( string fieldName ) : DiagnosticInfo
fieldName string
return DiagnosticInfo

ReadDiagnosticInfoArray() public method

Reads an DiagnosticInfo array from the stream.
public ReadDiagnosticInfoArray ( string fieldName ) : DiagnosticInfoCollection
fieldName string
return DiagnosticInfoCollection

ReadDouble() public method

Reads a double from the stream.
public ReadDouble ( string fieldName ) : double
fieldName string
return double

ReadDoubleArray() public method

Reads a double array from the stream.
public ReadDoubleArray ( string fieldName ) : DoubleCollection
fieldName string
return DoubleCollection

ReadEncodeable() public method

Reads an encodeable object from the stream.
public ReadEncodeable ( string fieldName, System systemType ) : IEncodeable
fieldName string
systemType System
return IEncodeable

ReadEncodeableArray() public method

Reads an encodeable object array from the stream.
public ReadEncodeableArray ( string fieldName, System systemType ) : Array
fieldName string
systemType System
return System.Array

ReadEnumerated() public method

Reads an enumerated value from the stream.
public ReadEnumerated ( string fieldName, System enumType ) : Enum
fieldName string
enumType System
return System.Enum

ReadEnumeratedArray() public method

Reads an enumerated value array from the stream.
public ReadEnumeratedArray ( string fieldName, System enumType ) : Array
fieldName string
enumType System
return System.Array

ReadExpandedNodeId() public method

Reads an ExpandedNodeId from the stream.
public ReadExpandedNodeId ( string fieldName ) : Opc.Ua.ExpandedNodeId
fieldName string
return Opc.Ua.ExpandedNodeId

ReadExpandedNodeIdArray() public method

Reads an ExpandedNodeId array from the stream.
public ReadExpandedNodeIdArray ( string fieldName ) : ExpandedNodeIdCollection
fieldName string
return ExpandedNodeIdCollection

ReadExtensionObject() public method

Reads an ExtensionObject from the stream.
public ReadExtensionObject ( string fieldName ) : Opc.Ua.ExtensionObject
fieldName string
return Opc.Ua.ExtensionObject

ReadExtensionObjectArray() public method

Reads an extension object array from the stream.
public ReadExtensionObjectArray ( string fieldName ) : ExtensionObjectCollection
fieldName string
return ExtensionObjectCollection

ReadFloat() public method

Reads a float from the stream.
public ReadFloat ( string fieldName ) : float
fieldName string
return float

ReadFloatArray() public method

Reads a float array from the stream.
public ReadFloatArray ( string fieldName ) : FloatCollection
fieldName string
return FloatCollection

ReadGuid() public method

Reads a GUID from the stream.
public ReadGuid ( string fieldName ) : Uuid
fieldName string
return Uuid

ReadGuidArray() public method

Reads a GUID array from the stream.
public ReadGuidArray ( string fieldName ) : UuidCollection
fieldName string
return UuidCollection

ReadInt16() public method

Reads a short from the stream.
public ReadInt16 ( string fieldName ) : short
fieldName string
return short

ReadInt16Array() public method

Reads a short array from the stream.
public ReadInt16Array ( string fieldName ) : Int16Collection
fieldName string
return Int16Collection

ReadInt32() public method

Reads an int from the stream.
public ReadInt32 ( string fieldName ) : int
fieldName string
return int

ReadInt32Array() public method

Reads a int array from the stream.
public ReadInt32Array ( string fieldName ) : Int32Collection
fieldName string
return Int32Collection

ReadInt64() public method

Reads a long from the stream.
public ReadInt64 ( string fieldName ) : long
fieldName string
return long

ReadInt64Array() public method

Reads a long array from the stream.
public ReadInt64Array ( string fieldName ) : Int64Collection
fieldName string
return Int64Collection

ReadLocalizedText() public method

Reads an LocalizedText from the stream.
public ReadLocalizedText ( string fieldName ) : Opc.Ua.LocalizedText
fieldName string
return Opc.Ua.LocalizedText

ReadLocalizedTextArray() public method

Reads an LocalizedText array from the stream.
public ReadLocalizedTextArray ( string fieldName ) : LocalizedTextCollection
fieldName string
return LocalizedTextCollection

ReadNodeId() public method

Reads an NodeId from the stream.
public ReadNodeId ( string fieldName ) : Opc.Ua.NodeId
fieldName string
return Opc.Ua.NodeId

ReadNodeIdArray() public method

Reads an NodeId array from the stream.
public ReadNodeIdArray ( string fieldName ) : NodeIdCollection
fieldName string
return NodeIdCollection

ReadQualifiedName() public method

Reads an QualifiedName from the stream.
public ReadQualifiedName ( string fieldName ) : Opc.Ua.QualifiedName
fieldName string
return Opc.Ua.QualifiedName

ReadQualifiedNameArray() public method

Reads an QualifiedName array from the stream.
public ReadQualifiedNameArray ( string fieldName ) : QualifiedNameCollection
fieldName string
return QualifiedNameCollection

ReadSByte() public method

Reads a sbyte from the stream.
public ReadSByte ( string fieldName ) : sbyte
fieldName string
return sbyte

ReadSByteArray() public method

Reads a sbyte array from the stream.
public ReadSByteArray ( string fieldName ) : SByteCollection
fieldName string
return SByteCollection

ReadStatusCode() public method

Reads an StatusCode from the stream.
public ReadStatusCode ( string fieldName ) : Opc.Ua.StatusCode
fieldName string
return Opc.Ua.StatusCode

ReadStatusCodeArray() public method

Reads an StatusCode array from the stream.
public ReadStatusCodeArray ( string fieldName ) : StatusCodeCollection
fieldName string
return StatusCodeCollection

ReadString() public method

Reads a string from the stream.
public ReadString ( string fieldName ) : string
fieldName string
return string

ReadString() public method

Reads a string from the stream (throws an exception if its length exceeds the limit specified).
public ReadString ( string fieldName, int maxStringLength ) : string
fieldName string
maxStringLength int
return string

ReadStringArray() public method

Reads a string array from the stream.
public ReadStringArray ( string fieldName ) : StringCollection
fieldName string
return StringCollection

ReadUInt16() public method

Reads a ushort from the stream.
public ReadUInt16 ( string fieldName ) : ushort
fieldName string
return ushort

ReadUInt16Array() public method

Reads a ushort array from the stream.
public ReadUInt16Array ( string fieldName ) : UInt16Collection
fieldName string
return UInt16Collection

ReadUInt32() public method

Reads a uint from the stream.
public ReadUInt32 ( string fieldName ) : uint
fieldName string
return uint

ReadUInt32Array() public method

Reads a uint array from the stream.
public ReadUInt32Array ( string fieldName ) : UInt32Collection
fieldName string
return UInt32Collection

ReadUInt64() public method

Reads a ulong from the stream.
public ReadUInt64 ( string fieldName ) : ulong
fieldName string
return ulong

ReadUInt64Array() public method

Reads a ulong array from the stream.
public ReadUInt64Array ( string fieldName ) : UInt64Collection
fieldName string
return UInt64Collection

ReadVariantArray() public method

Reads an Variant array from the stream.
public ReadVariantArray ( string fieldName ) : VariantCollection
fieldName string
return VariantCollection

ReadXmlElement() public method

Reads an XmlElement from the stream.
public ReadXmlElement ( string fieldName ) : XmlElement
fieldName string
return System.Xml.XmlElement

ReadXmlElementArray() public method

Reads an XmlElement array from the stream.
public ReadXmlElementArray ( string fieldName ) : XmlElementCollection
fieldName string
return System.Xml.XmlElementCollection

SetMappingTables() public method

Initializes the tables used to map namespace and server uris during decoding.
public SetMappingTables ( Opc.Ua.NamespaceTable namespaceUris, StringTable serverUris ) : void
namespaceUris Opc.Ua.NamespaceTable The namespaces URIs referenced by the data being decoded.
serverUris StringTable The server URIs referenced by the data being decoded.
return void