Table of Contents

UrlEncode Method

Definition

Namespace
Cuemon.Net
Assemblies
Cuemon.Net.dll
Source
src/Cuemon.Net/Extensions/ByteArrayDecoratorExtensions.cs

UrlEncode(IDecorator<byte[]>, int, int, Action<EncodingOptions>)

Converts the enclosed byte array 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 decorator that wraps the byte array to extend.

position int

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

bytesToRead int

The number of bytes to encode.

setup Action<EncodingOptions>

The EncodingOptions which may be configured.

Returns

byte[]

An encoded byte array.

Exceptions

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 array of the specified decorator - or - bytesToRead is greater than (the length of the enclosed byte array of the specified decorator minus position).