Provides utility methods for working with byte arrays and pointers.
More...
|
| static void | MemSet ([NotNull] this byte[] array, byte value) |
| | Fills the entire given byte array with a specified byte value, as efficiently as possible.
|
| |
| static void | MemSet ([NotNull] this byte[] array, byte value, int startIndex, int length) |
| | Fills a section of the given byte array with a specified byte value, as efficiently as possible.
|
| |
| static void | MemCpy ([NotNull] byte *src,[NotNull] byte *dest, int len) |
| | Copies contents of src buffer to dest buffer, as efficiently as possible.
|
| |
| static bool | MemCmp ([NotNull] byte[] data, int offset,[NotNull] string value) |
| | Checks whether the sequence of bytes in data at the given offset matches the sequence of ASCII characters in value. Basically, checks whether the byte array contains the string at this offset.
|
| |
| static void | ReadAll ([NotNull] Stream source,[NotNull] byte[] destination) |
| | Reads a number of bytes from source that matches the length of destination byte array.
|
| |
Provides utility methods for working with byte arrays and pointers.
| static bool fCraft.BufferUtil.MemCmp |
( |
[NotNull] byte[] |
data, |
|
|
int |
offset, |
|
|
[NotNull] string |
value |
|
) |
| |
|
static |
Checks whether the sequence of bytes in data at the given offset matches the sequence of ASCII characters in value. Basically, checks whether the byte array contains the string at this offset.
- Parameters
-
| data | Byte array to search. |
| offset | Offset, in bytes, from the start of data. |
| value | Value to search for. Must contain only ASCII characters. |
- Returns
- Whether the pattern was found.
- Exceptions
-
| ArgumentNullException | data or value is null. |
| ArgumentOutOfRangeException | offset is less than 0 or greater than data.Length. |
| static void fCraft.BufferUtil.MemCpy |
( |
[NotNull] byte * |
src, |
|
|
[NotNull] byte * |
dest, |
|
|
int |
len |
|
) |
| |
|
static |
Copies contents of src buffer to dest buffer, as efficiently as possible.
- Parameters
-
| src | Source array/pointer. |
| dest | Destination array/pointer. |
| len | Number of bytes to copy. |
| static void fCraft.BufferUtil.MemSet |
( |
[NotNull] this byte[] |
array, |
|
|
byte |
value |
|
) |
| |
|
static |
Fills the entire given byte array with a specified byte value, as efficiently as possible.
- Parameters
-
| array | Array to work with. |
| value | Value to assign to each byte of the array. |
- Exceptions
-
| ArgumentNullException | array is null. |
| static void fCraft.BufferUtil.MemSet |
( |
[NotNull] this byte[] |
array, |
|
|
byte |
value, |
|
|
int |
startIndex, |
|
|
int |
length |
|
) |
| |
|
static |
Fills a section of the given byte array with a specified byte value, as efficiently as possible.
- Parameters
-
| array | Array to work with. |
| value | Value to assign to each byte of the array. |
| startIndex | Index of the first byte that should be set. |
| length | Number of bytes of the array to set. |
- Exceptions
-
| ArgumentNullException | array is null. |
| ArgumentOutOfRangeException | length is negative; startIndex is negative; or if (length+startIndex) is greater than array length. |
| static void fCraft.BufferUtil.ReadAll |
( |
[NotNull] Stream |
source, |
|
|
[NotNull] byte[] |
destination |
|
) |
| |
|
static |
Reads a number of bytes from source that matches the length of destination byte array.
- Parameters
-
| source | Stream to read from. |
| destination | Byte array to write to. Length of this array is used. |
- Exceptions
-
| ArgumentNullException | source or destination is null. |
| EndOfStreamException | The end of stream is reached before destination array was filled. |
The documentation for this class was generated from the following file: