Class ByteArrayExtensions
- Namespace
- Cuemon.Extensions.Net
- Assembly
- Cuemon.Extensions.Net.dll
Extension methods for the byte[].
public static class ByteArrayExtensions
- Inheritance
-
ByteArrayExtensions
Methods
UrlEncode(byte[], int, int, Action<EncodingOptions>)
Converts the specified bytes 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 byte[] bytes, int position = 0, int bytesToRead = -1, Action<EncodingOptions> setup = null)
Parameters
bytesbyte[]The 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
bytescannot be null.- ArgumentOutOfRangeException
positionis lower than 0 - or -bytesToReadis lower than 0 - or -positionis greater than or equal to the length ofbytes- or -bytesToReadis greater than (the length ofbytesminusposition).