Skip to content

Reference

ByteString Members

Defines a sequence of byte values.

Reference

ByteString Members ​

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

Constructors ​

ByteString ​

Initializes a new ByteString from the value specified.

csharp
public ByteString(params byte[] value)
vbnet
Public Sub New(ParamArray value As Byte())

Parameters

NameTypeDescription
valueparams Byte[]The array of byte values to represent or a null reference (Nothing in Visual Basic).

Remarks

If value is a null reference (Nothing in Visual Basic) an empty array of byte values is used.

Properties ​

Length ​

Gets the total number of elements in all the dimensions of the ByteString.

csharp
public int Length { get; }
vbnet
Public ReadOnly Property Length As Integer

Property value

Int32

The total number of elements in all the dimensions of the ByteString; zero if there are no elements in the array.

Methods ​

CompareTo ​

2 overloads

OverloadDescription
CompareTo(object)Compares the current ByteString with the other.
CompareTo(ByteString)Compares the current ByteString with another ByteString.

CompareTo(object) ​

Compares the current ByteString with the other.

csharp
public int CompareTo(object other)
vbnet
Public Function CompareTo(other As Object) As Integer

Parameters

NameTypeDescription
otherObjectThe ByteString to compare with this ByteString.

Returns

Int32

A 32-bit signed integer that indicates the relative order of the objects being compared (CompareTo(object)).

Implements

CompareTo(object)

CompareTo(ByteString) ​

Compares the current ByteString with another ByteString.

csharp
public int CompareTo(ByteString other)
vbnet
Public Function CompareTo(other As ByteString) As Integer

Parameters

NameTypeDescription
otherByteStringThe ByteString to compare with this ByteString.

Returns

Int32

A 32-bit signed integer that indicates the relative order of the objects being compared (CompareTo(T)).

Implements

CompareTo(ByteString)

Equals ​

2 overloads

OverloadDescription
Equals(object)overrideDetermines whether the specified other is equal to this ByteString.
Equals(ByteString)Determines whether the specified other is equal to this ByteString.

Equals(object) ​

override

Determines whether the specified other is equal to this ByteString.

csharp
public override bool Equals(object other)
vbnet
Public Overrides Function Equals(other As Object) As Boolean

Parameters

NameTypeDescription
otherObjectThe ByteString to compare to the current ByteString.

Returns

Boolean

The value true if the specified ByteString is equal to the current ByteString; otherwise the value false.

Overrides

Equals(object)

Equals(ByteString) ​

Determines whether the specified other is equal to this ByteString.

csharp
public bool Equals(ByteString other)
vbnet
Public Function Equals(other As ByteString) As Boolean

Parameters

NameTypeDescription
otherByteStringThe ByteString to compare to the current ByteString.

Returns

Boolean

The value true if the specified ByteString is equal to the current ByteString; otherwise the value false.

Implements

Equals(ByteString)

GetHashCode ​

override

Retrieves a hash code for this ByteString.

csharp
public override int GetHashCode()
vbnet
Public Overrides Function GetHashCode() As Integer

Returns

Int32

An int that contains the hash code for the ByteString.

Overrides

GetHashCode()

Parse ​

static

Converts the specified hex encoded byte array to its ByteString equivalent.

csharp
public static ByteString Parse(string value)
vbnet
Public Shared Function Parse(value As String) As ByteString

Parameters

NameTypeDescription
valueStringA string containing the hex encoded byte array to convert.

Returns

ByteString

A ByteString which represents the hex encoded byte array of the value specified.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe value is a null reference (Nothing in Visual Basic).
FormatExceptionThe value is not a valid hex encoded byte array.

ToArray ​

since v2.18

Copies the byte values of the ByteString to a new array.

csharp
public byte[] ToArray()
vbnet
Public Function ToArray() As Byte()

Returns

Byte[]

A new array with a copy of the byte values of the ByteString; an empty array if the ByteString has no value.

ToString ​

override

Converts the value of this instance to its equivalent hex encoded string representation.

csharp
public override string ToString()
vbnet
Public Overrides Function ToString() As String

Returns

String

The hex encoded string representation.

Overrides

ToString()

TryParse ​

static

Tries to convert the specified hex encoded byte array to its ByteString equivalent. A return value indicates whether the conversion succeeded or failed.

csharp
public static bool TryParse(string value, out ByteString result)
vbnet
Public Shared Function TryParse(
    value As String,
    result As ByteString) As Boolean

Parameters

NameTypeDescription
valueStringA string containing the hex encoded byte array to convert.
resultout ByteStringWhen this method returns, if the conversion succeeded, the ByteString if value is a valid hex encoded byte array. If the conversion failed, contains a default ByteString. The conversion fails if value is a null reference (Nothing in Visual Basic) or is not a valid hex encoded byte array.

Returns

Boolean

The value true if value was converted successfully; otherwise the value false.

Operators ​

Equality ​

static

Returns a value indicating whether two values of ByteString are equal.

csharp
public static bool operator ==(ByteString left, ByteString right)
vbnet
Public Shared Operator =(left As ByteString, right As ByteString) As Boolean

Parameters

NameTypeDescription
leftByteStringThe first ByteString to compare.
rightByteStringThe second ByteString to compare.

Returns

Boolean

The value true if left and right are equal; otherwise the value false.

Explicit ​

static

Converts a ByteString to a byte array.

csharp
public static explicit operator byte[](ByteString value)
vbnet
Public Shared Narrowing Operator CType(value As ByteString) As Byte()

Parameters

NameTypeDescription
valueByteStringThe ByteString value.

Returns

Byte[]

The byte array of the value.

GreaterThan ​

static

Determines whether the first specified ByteString value is greater than the second specified ByteString value.

csharp
public static bool operator >(ByteString left, ByteString right)
vbnet
Public Shared Operator >(left As ByteString, right As ByteString) As Boolean

Parameters

NameTypeDescription
leftByteStringThe first ByteString value.
rightByteStringThe second ByteString value.

Returns

Boolean

The value true if left is greater than right; otherwise, false.

GreaterThanOrEqual ​

static

Determines whether the first specified ByteString value is greater than or equal to the second specified ByteString value.

csharp
public static bool operator >=(ByteString left, ByteString right)
vbnet
Public Shared Operator >=(left As ByteString, right As ByteString) As Boolean

Parameters

NameTypeDescription
leftByteStringThe first ByteString value.
rightByteStringThe second ByteString value.

Returns

Boolean

The value true if left is greater than or equal to right; otherwise, false.

Implicit ​

static · 2 overloads

OverloadDescription
implicit operator ByteString(byte)staticConverts a byte to a ByteString value.
implicit operator ByteString(byte[])staticConverts a byte array to a ByteString value.

implicit operator ByteString(byte) ​

static

Converts a byte to a ByteString value.

csharp
public static implicit operator ByteString(byte value)
vbnet
Public Shared Widening Operator CType(value As Byte) As ByteString

Parameters

NameTypeDescription
valueByteThe byte value.

Returns

ByteString

The ByteString value from the value.

implicit operator ByteString(byte[]) ​

static

Converts a byte array to a ByteString value.

csharp
public static implicit operator ByteString(byte[] value)
vbnet
Public Shared Widening Operator CType(value As Byte()) As ByteString

Parameters

NameTypeDescription
valueByte[]The byte array.

Returns

ByteString

The ByteString value from the value or a null reference (Nothing in Visual Basic) if value is a null reference (Nothing in Visual Basic).

Inequality ​

static

Returns a value indicating whether two values of ByteString are not equal.

csharp
public static bool operator !=(ByteString left, ByteString right)
vbnet
Public Shared Operator <>(left As ByteString, right As ByteString) As Boolean

Parameters

NameTypeDescription
leftByteStringThe first ByteString to compare.
rightByteStringThe second ByteString to compare.

Returns

Boolean

The value true if left and right are not equal; otherwise the value false.

LessThan ​

static

Determines whether the first specified ByteString value is less than the second specified ByteString value.

csharp
public static bool operator <(ByteString left, ByteString right)
vbnet
Public Shared Operator <(left As ByteString, right As ByteString) As Boolean

Parameters

NameTypeDescription
leftByteStringThe first ByteString value.
rightByteStringThe second ByteString value.

Returns

Boolean

The value true if left is less than right; otherwise the value false.

LessThanOrEqual ​

static

Determines whether the first specified ByteString value is less than or equal to the second ByteString value.

csharp
public static bool operator <=(ByteString left, ByteString right)
vbnet
Public Shared Operator <=(left As ByteString, right As ByteString) As Boolean

Parameters

NameTypeDescription
leftByteStringThe first ByteString value.
rightByteStringThe second ByteString value.

Returns

Boolean

The value true if left is less than or equal to right; otherwise the value false.

Indexers ​

Item ​

Gets the byte at the specified index.

csharp
public byte this[int index] { get; set; }
vbnet
Public Default Property this[](index As Integer) As Byte

Parameters

NameTypeDescription
indexInt32The zero-based index of the element to get.

Property value

Byte

The byte at the specified index.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe index is not valid index in the ByteString.