Table of Contents

Class OctetString

Namespace
Lextm.SharpSnmpLib
Assembly
SharpSnmpLib.dll

OctetString type.

public sealed class OctetString : ISnmpData, IEquatable<OctetString>
Inheritance
OctetString
Implements
Inherited Members
Extension Methods

Constructors

OctetString(Levels)

Creates an OctetString with a specific Levels.

public OctetString(Levels level)

Parameters

level Levels

OctetString(byte[])

Creates an OctetString from raw bytes.

public OctetString(byte[] raw)

Parameters

raw byte[]

Raw bytes

OctetString(string)

Creates an OctetString with a specific string. This string is treated as UTF-16.

public OctetString(string content)

Parameters

content string

String.

OctetString(string, Encoding)

Creates an OctetString with a specific string. This string is treated in specific Encoding.

public OctetString(string content, Encoding encoding)

Parameters

content string

String.

encoding Encoding

Encoding.

OctetString(Tuple<int, byte[]>, Stream)

Initializes a new instance of the OctetString class.

public OctetString(Tuple<int, byte[]> length, Stream stream)

Parameters

length Tuple<int, byte[]>

The length.

stream Stream

The stream.

Properties

DefaultEncoding

Default encoding of OctetString type.

public static Encoding DefaultEncoding { get; set; }

Property Value

Encoding

Empty

Gets the empty string.

public static OctetString Empty { get; }

Property Value

OctetString

The empty.

Encoding

Encoding of this OctetString

public Encoding Encoding { get; }

Property Value

Encoding

TypeCode

Type code.

public SnmpType TypeCode { get; }

Property Value

SnmpType

Methods

AppendBytesTo(Stream)

Appends the bytes to Stream.

public void AppendBytesTo(Stream stream)

Parameters

stream Stream

The stream.

Equals(OctetString?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(OctetString? other)

Parameters

other OctetString

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current OctetString.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current OctetString.

Returns

bool

true if the specified object is equal to the current OctetString; otherwise, false.

GetHashCode()

Serves as a hash function for a particular type.

public override int GetHashCode()

Returns

int

A hash code for the current OctetString.

GetRaw()

Gets raw bytes.

public byte[] GetRaw()

Returns

byte[]

IsNullOrEmpty(OctetString?)

Indicates whether the specified OctetString object is a null reference (Nothing in Visual Basic) or an Empty string.

public static bool IsNullOrEmpty(OctetString? value)

Parameters

value OctetString

A OctetString reference.

Returns

bool

true if the value parameter is a null reference (Nothing in Visual Basic) or an empty string (""); otherwise, false.

ToHexString()

Returns a string in a hex form that represents this OctetString.

public string ToHexString()

Returns

string

ToLevels()

Returns a Levels that represents this OctetString.

public Levels ToLevels()

Returns

Levels

ToPhysicalAddress()

Converts octets to physical address.

public PhysicalAddress ToPhysicalAddress()

Returns

PhysicalAddress

ToString()

Returns a string in UTF-16 that represents this OctetString.

public override string ToString()

Returns

string

ToString(Encoding)

Returns a string in a specific Encoding that represents this OctetString.

public string ToString(Encoding encoding)

Parameters

encoding Encoding

Returns

string

Operators

operator ==(OctetString?, OctetString?)

The equality operator.

public static bool operator ==(OctetString? left, OctetString? right)

Parameters

left OctetString

Left OctetString object

right OctetString

Right OctetString object

Returns

bool

Returns true if the values of its operands are equal, false otherwise.

operator !=(OctetString?, OctetString?)

The inequality operator.

public static bool operator !=(OctetString? left, OctetString? right)

Parameters

left OctetString

Left OctetString object

right OctetString

Right OctetString object

Returns

bool

Returns true if the values of its operands are not equal, false otherwise.