Class ByteArrayDecoratorExtensions
Extension methods for the byte[] hidden behind the IDecorator<T> interface.
public static class ByteArrayDecoratorExtensions
- Inheritance
-
ByteArrayDecoratorExtensions
Methods
UrlEncode(IDecorator<byte[]>, int, int, 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
decoratorIDecorator<byte[]>The IDecorator{byte[]} 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
- byte[]
An encoded byte[].
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[] of the specifieddecorator- or -bytesToReadis greater than (the length of the enclosed byte[] of the specifieddecoratorminusposition).