public GetChars ( byte bytes, int index, int count ) : char[] | ||
bytes | byte | |
index | int | |
count | int | |
return | char[] |
public virtual char[] GetChars(byte[] bytes, int index, int count)
{
char[] result = new char[GetCharCount(bytes, index, count)];
GetChars(bytes, index, count, result, 0);
return result;
}
Encoding::GetChars ( byte bytes ) : char[] | |
Encoding::GetChars ( byte bytes, int byteCount, char chars, int charCount ) : int | |
Encoding::GetChars ( byte bytes, int byteCount, char chars, int charCount, |
|
Encoding::GetChars ( byte bytes, int byteIndex, int byteCount, char chars, int charIndex ) : int |
public bool TryReadTextString(Span <char> destination, out int charsWritten) { CborInitialByte header = PeekInitialByte(expectedType: CborMajorType.TextString); if (header.AdditionalInfo == CborAdditionalInfo.IndefiniteLength) { return(TryReadChunkedTextStringConcatenated(destination, out charsWritten)); } int byteLength = checked ((int)ReadUnsignedInteger(_buffer.Span, header, out int additionalBytes)); EnsureBuffer(1 + additionalBytes + byteLength); ReadOnlySpan <byte> encodedSlice = _buffer.Span.Slice(1 + additionalBytes, byteLength); int charLength = ValidateUtf8AndGetCharCount(encodedSlice); if (charLength > destination.Length) { charsWritten = 0; return(false); } s_utf8Encoding.GetChars(encodedSlice, destination); AdvanceBuffer(1 + additionalBytes + byteLength); AdvanceDataItemCounters(); charsWritten = charLength; return(true); }