Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetCharCount() [4/5]

unsafe override int System.Text.ASCIIEncoding.GetCharCount ( byte[] bytes,
int index,
int count )
inlineinherited

Definition at line 246 of file ASCIIEncoding.cs.

247 {
248 if (bytes == null)
249 {
250 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.bytes, ExceptionResource.ArgumentNull_Array);
251 }
252 if ((index | count) < 0)
253 {
254 ThrowHelper.ThrowArgumentOutOfRangeException((index < 0) ? ExceptionArgument.index : ExceptionArgument.count, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum);
255 }
256 if (bytes.Length - index < count)
257 {
258 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.bytes, ExceptionResource.ArgumentOutOfRange_IndexCountBuffer);
259 }
260 fixed (byte* ptr = bytes)
261 {
262 return GetCharCountCommon(ptr + index, count);
263 }
264 }
unsafe int GetCharCountCommon(byte *pBytes, int byteCount)

References System.bytes, System.count, System.Text.ASCIIEncoding.GetCharCountCommon(), System.index, System.ThrowHelper.ThrowArgumentNullException(), and System.ThrowHelper.ThrowArgumentOutOfRangeException().