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.
public ByteString(params byte[] value)Public Sub New(ParamArray value As Byte())Parameters
| Name | Type | Description |
|---|---|---|
value | params Byte[] | The array of byte values to represent or a null reference ( |
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.
public int Length { get; }Public ReadOnly Property Length As IntegerProperty value
The total number of elements in all the dimensions of the ByteString; zero if there are no elements in the array.
Methods
CompareTo
| Overload | Description |
|---|---|
| CompareTo( | Compares the current ByteString with the other. |
| CompareTo( | Compares the current ByteString with another ByteString. |
CompareTo(object)
Compares the current ByteString with the other.
public int CompareTo(object other)Public Function CompareTo(other As Object) As IntegerParameters
| Name | Type | Description |
|---|---|---|
other | Object | The ByteString to compare with this ByteString. |
Returns
A 32-bit signed integer that indicates the relative order of the objects being compared (CompareTo(object)).
Implements
CompareTo(ByteString)
Compares the current ByteString with another ByteString.
public int CompareTo(ByteString other)Public Function CompareTo(other As ByteString) As IntegerParameters
| Name | Type | Description |
|---|---|---|
other | ByteString | The ByteString to compare with this ByteString. |
Returns
A 32-bit signed integer that indicates the relative order of the objects being compared (CompareTo(T)).
Implements
Equals
| Overload | Description |
|---|---|
| Equals( | Determines whether the specified other is equal to this ByteString. |
| Equals( | Determines whether the specified other is equal to this ByteString. |
Equals(object)
Determines whether the specified other is equal to this ByteString.
public override bool Equals(object other)Public Overrides Function Equals(other As Object) As BooleanParameters
| Name | Type | Description |
|---|---|---|
other | Object | The ByteString to compare to the current ByteString. |
Returns
The value true if the specified ByteString is equal to the current ByteString; otherwise the value false.
Overrides
Equals(ByteString)
Determines whether the specified other is equal to this ByteString.
public bool Equals(ByteString other)Public Function Equals(other As ByteString) As BooleanParameters
| Name | Type | Description |
|---|---|---|
other | ByteString | The ByteString to compare to the current ByteString. |
Returns
The value true if the specified ByteString is equal to the current ByteString; otherwise the value false.
Implements
GetHashCode
Retrieves a hash code for this ByteString.
public override int GetHashCode()Public Overrides Function GetHashCode() As IntegerReturns
An int that contains the hash code for the ByteString.
Overrides
Parse
Converts the specified hex encoded byte array to its ByteString equivalent.
public static ByteString Parse(string value)Public Shared Function Parse(value As String) As ByteStringParameters
| Name | Type | Description |
|---|---|---|
value | String | A string containing the hex encoded byte array to convert. |
Returns
A ByteString which represents the hex encoded byte array of the value specified.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The value is a null reference ( |
| FormatException | The value is not a valid hex encoded byte array. |
ToArray
Copies the byte values of the ByteString to a new array.
public byte[] ToArray()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
Converts the value of this instance to its equivalent hex encoded string representation.
public override string ToString()Public Overrides Function ToString() As StringReturns
The hex encoded string representation.
Overrides
TryParse
Tries to convert the specified hex encoded byte array to its ByteString equivalent. A return value indicates whether the conversion succeeded or failed.
public static bool TryParse(string value, out ByteString result)Public Shared Function TryParse(
value As String,
result As ByteString) As BooleanParameters
| Name | Type | Description |
|---|---|---|
value | String | A string containing the hex encoded byte array to convert. |
result | out ByteString | When 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 ( |
Returns
The value true if value was converted successfully; otherwise the value false.
Operators
Equality
Returns a value indicating whether two values of ByteString are equal.
public static bool operator ==(ByteString left, ByteString right)Public Shared Operator =(left As ByteString, right As ByteString) As BooleanParameters
| Name | Type | Description |
|---|---|---|
left | ByteString | The first ByteString to compare. |
right | ByteString | The second ByteString to compare. |
Returns
The value true if left and right are equal; otherwise the value false.
Explicit
Converts a ByteString to a byte array.
public static explicit operator byte[](ByteString value)Public Shared Narrowing Operator CType(value As ByteString) As Byte()Parameters
| Name | Type | Description |
|---|---|---|
value | ByteString | The ByteString value. |
Returns
Byte[]
The byte array of the value.
GreaterThan
Determines whether the first specified ByteString value is greater than the second specified ByteString value.
public static bool operator >(ByteString left, ByteString right)Public Shared Operator >(left As ByteString, right As ByteString) As BooleanParameters
| Name | Type | Description |
|---|---|---|
left | ByteString | The first ByteString value. |
right | ByteString | The second ByteString value. |
Returns
The value true if left is greater than right; otherwise, false.
GreaterThanOrEqual
Determines whether the first specified ByteString value is greater than or equal to the second specified ByteString value.
public static bool operator >=(ByteString left, ByteString right)Public Shared Operator >=(left As ByteString, right As ByteString) As BooleanParameters
| Name | Type | Description |
|---|---|---|
left | ByteString | The first ByteString value. |
right | ByteString | The second ByteString value. |
Returns
The value true if left is greater than or equal to right; otherwise, false.
Implicit
| Overload | Description |
|---|---|
| implicit operator ByteString( | Converts a byte to a ByteString value. |
| implicit operator ByteString( | Converts a byte array to a ByteString value. |
implicit operator ByteString(byte)
Converts a byte to a ByteString value.
public static implicit operator ByteString(byte value)Public Shared Widening Operator CType(value As Byte) As ByteStringParameters
| Name | Type | Description |
|---|---|---|
value | Byte | The byte value. |
Returns
The ByteString value from the value.
implicit operator ByteString(byte[])
Converts a byte array to a ByteString value.
public static implicit operator ByteString(byte[] value)Public Shared Widening Operator CType(value As Byte()) As ByteStringParameters
| Name | Type | Description |
|---|---|---|
value | Byte[] | The byte array. |
Returns
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
Returns a value indicating whether two values of ByteString are not equal.
public static bool operator !=(ByteString left, ByteString right)Public Shared Operator <>(left As ByteString, right As ByteString) As BooleanParameters
| Name | Type | Description |
|---|---|---|
left | ByteString | The first ByteString to compare. |
right | ByteString | The second ByteString to compare. |
Returns
The value true if left and right are not equal; otherwise the value false.
LessThan
Determines whether the first specified ByteString value is less than the second specified ByteString value.
public static bool operator <(ByteString left, ByteString right)Public Shared Operator <(left As ByteString, right As ByteString) As BooleanParameters
| Name | Type | Description |
|---|---|---|
left | ByteString | The first ByteString value. |
right | ByteString | The second ByteString value. |
Returns
The value true if left is less than right; otherwise the value false.
LessThanOrEqual
Determines whether the first specified ByteString value is less than or equal to the second ByteString value.
public static bool operator <=(ByteString left, ByteString right)Public Shared Operator <=(left As ByteString, right As ByteString) As BooleanParameters
| Name | Type | Description |
|---|---|---|
left | ByteString | The first ByteString value. |
right | ByteString | The second ByteString value. |
Returns
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.
public byte this[int index] { get; set; }Public Default Property this[](index As Integer) As ByteParameters
| Name | Type | Description |
|---|---|---|
index | Int32 | The zero-based index of the element to get. |
Property value
The byte at the specified index.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The index is not valid index in the ByteString. |

