Table of Contents

Class ByteArrayDecoratorExtensions

Namespace
Cuemon.Net
Assembly
Cuemon.Net.dll

Extension methods for the byte[] hidden behind the IDecorator<T> interface.

public static class ByteArrayDecoratorExtensions
Inheritance
Object
ByteArrayDecoratorExtensions

Methods

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

Converts the enclosed byte[] of the specified decorator 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 IDecorator<byte[]> decorator, int position = 0, int bytesToRead = -1, Action<EncodingOptions> setup = null)

Parameters

decorator IDecorator<Byte[]>

The IDecorator{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

decorator cannot be null.

ArgumentOutOfRangeException

position is lower than 0 - or - bytesToRead is lower than 0 - or - position is greater than or equal to the length of the enclosed byte[] of the specified decorator - or - bytesToRead is greater than (the length of the enclosed byte[] of the specified decorator minus position).

See Also