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
-
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
Int32The position in the byte array at which to begin encoding.
bytesToRead
Int32The number of bytes to encode.
setup
Action<EncodingOptions>The EncodingOptions which may be configured.
Returns
- Byte[]
An encoded byte[].
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[] of the specifieddecorator
- or -bytesToRead
is greater than (the length of the enclosed byte[] of the specifieddecorator
minusposition
).