UrlEncode Method
Definition
- Assemblies
- Cuemon.Net.dll
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
decoratorIDecorator<byte[]>The decorator that wraps the byte array to extend.
positionintThe position in the byte array at which to begin encoding.
bytesToReadintThe number of bytes to encode.
setupAction<EncodingOptions>The EncodingOptions which may be configured.
Returns
Exceptions
- ArgumentNullException
decoratorcannot be null.- ArgumentOutOfRangeException
positionis lower than 0 - or -bytesToReadis lower than 0 - or -positionis greater than or equal to the length of the enclosed byte array of the specifieddecorator- or -bytesToReadis greater than (the length of the enclosed byte array of the specifieddecoratorminusposition).