Table of Contents

Class ByteArrayExtensions

Namespace
Cuemon.Extensions.Net
Assembly
Cuemon.Extensions.Net.dll

Extension methods for the byte[].

public static class ByteArrayExtensions
Inheritance
Object
ByteArrayExtensions

Methods

UrlEncode(Byte[], Int32, Int32, Action<EncodingOptions>)

Converts the specified bytes into a URL-encoded array of bytes, starting at the specified position in the array and continuing for the specified number of bytesToRead.

public static byte[] UrlEncode(this byte[] bytes, int position = 0, int bytesToRead = -1, Action<EncodingOptions> setup = null)

Parameters

bytes Byte[]

The byte[] to extend.

position Int32

The position in the byte array at which to begin encoding.

bytesToRead Int32

The number of bytes to encode.

setup Action<EncodingOptions>

The EncodingOptions which may be configured.

Returns

Byte[]

An encoded byte[].

Exceptions

System.ArgumentNullException

bytes cannot be null.

System.ArgumentOutOfRangeException

position is lower than 0 - or - bytesToRead is lower than 0 - or - position is greater than or equal to the length of bytes - or - bytesToRead is greater than (the length of bytes minus position).