Xeno-rat
Loading...
Searching...
No Matches
NAudio.Utils.ByteArrayExtensions Class Reference

these will become extension methods once we move to .NET 3.5 More...

Collaboration diagram for NAudio.Utils.ByteArrayExtensions:

Static Public Member Functions

static bool IsEntirelyNull (byte[] buffer)
 Checks if the entire byte array is filled with null values.
 
static string DescribeAsHex (byte[] buffer, string separator, int bytesPerLine)
 Converts the input byte array to a hexadecimal string with the specified separator and bytes per line.
 
static string DecodeAsString (byte[] buffer, int offset, int length, Encoding encoding)
 Decodes a portion of a byte array into a string using the specified encoding and returns the result.
 
static byte[] Concat (params byte[][] byteArrays)
 Concatenates multiple byte arrays into a single byte array and returns the result.
 

Detailed Description

these will become extension methods once we move to .NET 3.5

Member Function Documentation

◆ Concat()

static byte[] NAudio.Utils.ByteArrayExtensions.Concat ( params byte byteArrays[][])
inlinestatic

Concatenates multiple byte arrays into a single byte array and returns the result.

Parameters
byteArraysThe byte arrays to be concatenated.
Returns
A byte array containing the concatenated elements of byteArrays .

This method calculates the total size required for the concatenated byte array by summing the lengths of all input byte arrays. It then creates a new byte array of the calculated size and copies the elements of each input byte array into the new array. The resulting byte array is returned as the concatenation of all input byte arrays. If the total size is less than or equal to 0, an empty byte array is returned.

Here is the caller graph for this function:

◆ DecodeAsString()

static string NAudio.Utils.ByteArrayExtensions.DecodeAsString ( byte[] buffer,
int offset,
int length,
Encoding encoding )
inlinestatic

Decodes a portion of a byte array into a string using the specified encoding and returns the result.

Parameters
bufferThe input byte array.
offsetThe zero-based byte offset in buffer at which to begin decoding.
lengthThe number of bytes to decode.
encodingThe character encoding to use.
Returns
A string that contains the results of decoding the specified sequence of bytes.

This method decodes a portion of the input byte array buffer into a string using the specified character encoding encoding . It starts at the specified byte offset and decodes the specified length number of bytes. If a null byte is encountered within the specified length, the decoding stops at that position.

◆ DescribeAsHex()

static string NAudio.Utils.ByteArrayExtensions.DescribeAsHex ( byte[] buffer,
string separator,
int bytesPerLine )
inlinestatic

Converts the input byte array to a hexadecimal string with the specified separator and bytes per line.

Parameters
bufferThe byte array to be converted to hexadecimal string.
separatorThe separator to be used between hexadecimal values.
bytesPerLineThe number of bytes to be displayed per line in the output.
Returns
A string representing the hexadecimal values of the input byte array with the specified separator and line formatting.

◆ IsEntirelyNull()

static bool NAudio.Utils.ByteArrayExtensions.IsEntirelyNull ( byte[] buffer)
inlinestatic

Checks if the entire byte array is filled with null values.

Parameters
bufferThe byte array to be checked.
Returns
True if the entire byte array is filled with null values; otherwise, false.

The documentation for this class was generated from the following file: