private GetByteCount ( char chars, int index, int count ) : int | ||
chars | char | |
index | int | |
count | int | |
리턴 | int |
public unsafe override int GetByteCount(char[] chars, int index, int count)
{
// Validate input parameters
if (chars == null)
throw new ArgumentNullException(nameof(chars), SR.ArgumentNull_Array);
if (index < 0 || count < 0)
throw new ArgumentOutOfRangeException((index < 0 ? nameof(index): nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum);
if (chars.Length - index < count)
throw new ArgumentOutOfRangeException(nameof(chars), SR.ArgumentOutOfRange_IndexCountBuffer);
Contract.EndContractBlock();
// If no input, return 0, avoid fixed empty array problem
if (chars.Length == 0)
return 0;
// Just call the pointer version
fixed (char* pChars = chars)
return GetByteCount(pChars + index, count, null);
}
EncodingNLS::GetByteCount ( String s ) : int | |
EncodingNLS::GetByteCount ( char chars, int count ) : int | |
EncodingNLS::GetByteCount ( char chars, int count, |
public override unsafe int GetByteCount(char *chars, int count, bool flush) { if (chars is null) { throw new ArgumentNullException(nameof(chars)); } if (count < 0) { throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); } m_mustFlush = flush; m_throwOnOverflow = true; return(m_encoding.GetByteCount(chars, count, this)); }