An encoding for use with file types that have one byte per character.
More...
|
override int | GetByteCount (char[] chars, int index, int count) |
| Gets the number of bytes required to encode a set of characters from the specified character array.
|
|
override int | GetBytes (char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) |
| Encodes a set of characters from the specified character array into the specified byte array.
|
|
override int | GetCharCount (byte[] bytes, int index, int count) |
| Returns the number of characters produced by decoding a sequence of bytes from the specified byte array.
|
|
override int | GetChars (byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) |
| Decodes a sequence of bytes from the specified byte array into the specified character array.
|
|
override int | GetMaxCharCount (int byteCount) |
| Returns the maximum number of characters produced by decoding the specified number of bytes.
|
|
override int | GetMaxByteCount (int charCount) |
| Returns the maximum number of bytes required to encode the specified number of characters.
|
|
An encoding for use with file types that have one byte per character.
◆ ByteEncoding()
NAudio.Utils.ByteEncoding.ByteEncoding |
( |
| ) |
|
|
inlineprivate |
◆ GetByteCount()
override int NAudio.Utils.ByteEncoding.GetByteCount |
( |
char[] | chars, |
|
|
int | index, |
|
|
int | count ) |
|
inline |
Gets the number of bytes required to encode a set of characters from the specified character array.
- Parameters
-
chars | The character array containing the set of characters to encode. |
index | The index of the first character in the character array to encode. |
count | The number of characters to encode. |
- Returns
- The number of bytes required to encode the specified set of characters.
◆ GetBytes()
override int NAudio.Utils.ByteEncoding.GetBytes |
( |
char[] | chars, |
|
|
int | charIndex, |
|
|
int | charCount, |
|
|
byte[] | bytes, |
|
|
int | byteIndex ) |
|
inline |
Encodes a set of characters from the specified character array into the specified byte array.
- Parameters
-
chars | The character array containing the characters to encode. |
charIndex | The index of the first character to encode. |
charCount | The number of characters to encode. |
bytes | The byte array to contain the resulting sequence of bytes. |
byteIndex | The index at which to start writing the resulting sequence of bytes. |
- Returns
- The total number of bytes written into the byte array.
This method encodes a set of characters from the specified character array into the specified byte array. It iterates through the characters in the input character array and casts each character to a byte, then stores it in the output byte array. The method returns the total number of bytes written into the byte array, which is equal to the number of characters encoded.
◆ GetCharCount()
override int NAudio.Utils.ByteEncoding.GetCharCount |
( |
byte[] | bytes, |
|
|
int | index, |
|
|
int | count ) |
|
inline |
Returns the number of characters produced by decoding a sequence of bytes from the specified byte array.
- Parameters
-
bytes | The byte array containing the sequence of bytes to decode. |
index | The index of the first byte to decode. |
count | The number of bytes to decode. |
- Returns
- The number of characters produced by decoding the specified sequence of bytes.
This method iterates through the specified byte array starting from the given index and counts the number of characters until it encounters a null byte (0). If no null byte is encountered within the specified count, it returns the total count.
◆ GetChars()
override int NAudio.Utils.ByteEncoding.GetChars |
( |
byte[] | bytes, |
|
|
int | byteIndex, |
|
|
int | byteCount, |
|
|
char[] | chars, |
|
|
int | charIndex ) |
|
inline |
Decodes a sequence of bytes from the specified byte array into the specified character array.
- Parameters
-
bytes | The byte array containing the sequence of bytes to decode. |
byteIndex | The index of the first byte to decode. |
byteCount | The number of bytes to decode. |
chars | The character array to contain the resulting decoded characters. |
charIndex | The index at which to start writing the resulting decoded characters. |
- Returns
- The actual number of characters written into chars .
This method decodes a sequence of bytes from the specified byte array into the specified character array using the default character encoding. It starts at the specified byte index and decodes the specified number of bytes. If a null byte is encountered during decoding, the method returns the number of characters decoded up to that point.
◆ GetMaxByteCount()
override int NAudio.Utils.ByteEncoding.GetMaxByteCount |
( |
int | charCount | ) |
|
|
inline |
Returns the maximum number of bytes required to encode the specified number of characters.
- Parameters
-
charCount | The number of characters to encode. |
- Returns
- The maximum number of bytes required to encode the specified number of characters.
◆ GetMaxCharCount()
override int NAudio.Utils.ByteEncoding.GetMaxCharCount |
( |
int | byteCount | ) |
|
|
inline |
Returns the maximum number of characters produced by decoding the specified number of bytes.
- Parameters
-
byteCount | The number of bytes to decode. |
- Returns
- The maximum number of characters produced by decoding the specified number of bytes.
◆ Instance
The one and only instance of this class.
The documentation for this class was generated from the following file:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/Plugins/LiveMicrophone/lib/NAudio.Core/Utils/ByteEncoding.cs