Utility class for working with bytes. More...
Static Public Member Functions | |
static int | AddByteBlock (byte[] block, byte[] buffer, int offset) |
static int | AddValueBlock (int value, byte[] buffer, int offset) |
Adds a value block to a byte array. More... | |
static int | AddValueBlock (long value, byte[] buffer, int offset) |
Adds a value block to the specified byte array at the given offset. More... | |
static int | AddValueBlock (ulong value, byte[] buffer, int offset) |
Adds a value block to the specified byte array at the given offset. More... | |
static byte[] | Base64Decode (string data) |
Decodes a Base64 encoded string into a byte array. More... | |
static string | Base64DecodeString (string data, Encoding encoding) |
Decodes a Base64-encoded string to its original string representation using the specified encoding. More... | |
static string | Base64Encode (byte[] data) |
Encodes a byte array to a Base64 string. More... | |
static string | Base64EncodeString (string data, Encoding encoding) |
Base64 encodes a string using the specified encoding. More... | |
static int | BeginByteBlockHeader (byte[] buffer, int offset, out int blockStart) |
Begins a byte block header in the given buffer at the specified offset. More... | |
static GZipStream | CreateGZipCompressStream (Stream output) |
Decompresses a byte array using GZip. More... | |
static GZipStream | CreateGZipDecompressStream (Stream output) |
Decompresses a byte array using GZip. More... | |
static int | EndByteBlockHeader (byte[] buffer, int blockStart, int bytesWritten) |
Ends the byte block header by updating the block size in the byte array. More... | |
static Byte[] | GZipCompressBytes (Byte[] data) |
Compresses a byte array using GZip. More... | |
static void | GZipCompressBytes (Byte[] data, int offset, int size, Stream output) |
Compresses a byte array using GZip. More... | |
static void | GZipCompressBytes (Stream input, Stream output) |
Compresses a byte array using GZip. More... | |
static Byte[] | GZipCompressString (String data, Encoding encoding) |
Compresses a byte array using GZip. More... | |
static Byte[] | GZipDecompressBytes (Byte[] data) |
Decompresses a byte array using GZip. More... | |
static String | GZipDecompressString (Byte[] data, Encoding encoding) |
Decompresses a byte array using GZip. More... | |
static String | GZipDecompressString (Byte[] data, int offset, int size, Encoding encoding) |
Decompresses a byte array using GZip. More... | |
static Byte[] | MergeByteBlocks (params Byte[][] blocks) |
Merges multiple byte blocks into a single byte array. More... | |
static Byte[] | PackByteBlocks (params Byte[][] blocks) |
Takes multiple byte blocks and packs them into a single byte array. More... | |
static String | PrintBits (Array array, Int32 offset, Int32 length) |
Print the bits of an array starting at the specified offset and for the given length. More... | |
static IEnumerable< Byte[]> | ReadByteBlocks (Byte[] data) |
Read byte blocks from a byte array. More... | |
static unsafe Byte[] | ToByteArray (byte *ptr, int length) |
Convert a pointer to a byte array. More... | |
static unsafe int | WriteBytes (int value, byte[] array, int offset) |
Writes an integer value to a byte array at the specified offset. More... | |
static unsafe int | WriteBytes (long value, byte[] array, int offset) |
Writes a long value to a byte array at the specified offset. More... | |
static int | WriteBytes (ulong value, byte[] array, int offset) |
Writes an unsigned long value to a byte array at the specified offset. More... | |
Utility class for working with bytes.
|
inlinestatic |
Convert a pointer to a byte array.
ptr | The pointer to convert. |
length | The length of the byte array. |
|
inlinestatic |
Merges multiple byte blocks into a single byte array.
blocks | The byte blocks to merge. |
|
inlinestatic |
Adds a value block to a byte array.
value | The value to add to the byte array. |
buffer | The byte array to add the value block to. |
offset | The offset in the byte array to start adding the value block. |
|
inlinestatic |
Adds a value block to the specified byte array at the given offset.
value | The value to add to the byte array. |
buffer | The byte array. |
offset | The offset at which to add the value block. |
|
inlinestatic |
Adds a value block to the specified byte array at the given offset.
value | The value to add to the byte array. |
buffer | The byte array. |
offset | The offset at which to add the value block. |
|
inlinestatic |
block | |
buffer | |
offset |
|
inlinestatic |
Begins a byte block header in the given buffer at the specified offset.
buffer | The byte array buffer. |
offset | The offset at which to begin the byte block header. |
blockStart | The starting index of the byte block. |
|
inlinestatic |
Ends the byte block header by updating the block size in the byte array.
buffer | The byte array containing the block header. |
blockStart | The start index of the block header. |
bytesWritten | The number of bytes written in the block. |
|
inlinestatic |
Takes multiple byte blocks and packs them into a single byte array.
blocks | The byte blocks to pack. |
|
inlinestatic |
Read byte blocks from a byte array.
data | The byte array containing the byte blocks. |
|
inlinestatic |
Print the bits of an array starting at the specified offset and for the given length.
array | The array to print the bits from. |
offset | The offset within the array to start printing from. |
length | The length of the bits to print. |
|
inlinestatic |
Base64 encodes a string using the specified encoding.
data | The string to be encoded. |
encoding | The encoding to be used. |
|
inlinestatic |
Decodes a Base64-encoded string to its original string representation using the specified encoding.
data | The Base64-encoded string to decode. |
encoding | The encoding to use for the decoded string. |
|
inlinestatic |
Encodes a byte array to a Base64 string.
data | The byte array to encode. |
|
inlinestatic |
Decodes a Base64 encoded string into a byte array.
data | The Base64 encoded string to decode. |
|
inlinestatic |
Compresses a byte array using GZip.
data | The data to compress. |
|
inlinestatic |
Compresses a byte array using GZip.
data | The data to compress. |
offset | The offset in the data array to start compressing from. |
size | The size of the data to compress. |
output | The stream to write the data to. |
|
inlinestatic |
Compresses a byte array using GZip.
input | The stream to read the data from. |
output | The stream to write the compressed data to. |
|
inlinestatic |
Decompresses a byte array using GZip.
output | The stream to write the data to. |
|
inlinestatic |
Decompresses a byte array using GZip.
output | The stream to write the data to. |
|
inlinestatic |
Decompresses a byte array using GZip.
data | The data to decompress |
|
inlinestatic |
Compresses a byte array using GZip.
data | The string data to decompress. |
encoding | The encoding to use. |
|
inlinestatic |
Decompresses a byte array using GZip.
data | The string data to decompress. |
encoding | The encoding to use. |
|
inlinestatic |
Decompresses a byte array using GZip.
data | The string data to decompress. |
offset | The offset in the data array to start decompressing from. |
size | The size of the data to decompress. |
encoding | The encoding to use. |
|
inlinestatic |
Writes a long value to a byte array at the specified offset.
value | The long value to write. |
array | The byte array to write the value to. |
offset | The offset in the byte array to write the value to. |
|
inlinestatic |
Writes an unsigned long value to a byte array at the specified offset.
value | The unsigned long value to write. |
array | The byte array to write the value to. |
offset | The offset in the byte array to write the value to. |
|
inlinestatic |
Writes an integer value to a byte array at the specified offset.
value | The integer value to write. |
array | The byte array to write the value to. |
offset | The offset in the byte array to write the value to. |