Show / Hide Table of Contents

Class ByteArrayExtensions

This extension class enables some convenient methods to deal with byte array.

Inheritance
Object
ByteArrayExtensions
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
System.Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
System.Object.ToString()
Namespace: Libplanet.Common
Assembly: Libplanet.Common.dll
Syntax
public static class ByteArrayExtensions

Methods

| Improve this Doc View Source

IndexOf(Byte[], Byte[])

This extension class enables some convenient methods to deal with byte array.

Declaration
[Pure]
public static int IndexOf(this byte[] bytes, byte[] sub)
Parameters
Type Name Description
System.Byte[] bytes
System.Byte[] sub
Returns
Type Description
Int32
| Improve this Doc View Source

StartsWith(Byte[], Byte[])

Determines whether the beginning of this byte array instance matches a specified string.

Declaration
[Pure]
public static bool StartsWith(this byte[] bytes, byte[] prefix)
Parameters
Type Name Description
System.Byte[] bytes

A byte array to check.

System.Byte[] prefix

The prefix byte array to compare.

Returns
Type Description
System.Boolean

true if prefix matches the beginning of bytes; otherwise, false.

Exceptions
Type Condition
System.ArgumentNullException

bytes or prefix is null.

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2023 Planetarium