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

◆ GetChars() [4/6]

unsafe override int System.Text.UnicodeEncoding.GetChars ( byte[] bytes,
int byteIndex,
int byteCount,
char[] chars,
int charIndex )
inline

Definition at line 273 of file UnicodeEncoding.cs.

274 {
275 if (bytes == null || chars == null)
276 {
277 throw new ArgumentNullException((bytes == null) ? "bytes" : "chars", SR.ArgumentNull_Array);
278 }
279 if (byteIndex < 0 || byteCount < 0)
280 {
281 throw new ArgumentOutOfRangeException((byteIndex < 0) ? "byteIndex" : "byteCount", SR.ArgumentOutOfRange_NeedNonNegNum);
282 }
283 if (bytes.Length - byteIndex < byteCount)
284 {
285 throw new ArgumentOutOfRangeException("bytes", SR.ArgumentOutOfRange_IndexCountBuffer);
286 }
287 if (charIndex < 0 || charIndex > chars.Length)
288 {
289 throw new ArgumentOutOfRangeException("charIndex", SR.ArgumentOutOfRange_Index);
290 }
291 if (byteCount == 0)
292 {
293 return 0;
294 }
295 int charCount = chars.Length - charIndex;
296 fixed (byte* ptr = bytes)
297 {
298 fixed (char* ptr2 = &MemoryMarshal.GetReference<char>(chars))
299 {
300 return GetChars(ptr + byteIndex, byteCount, ptr2 + charIndex, charCount, null);
301 }
302 }
303 }
unsafe override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)

References System.SR.ArgumentNull_Array, System.SR.ArgumentOutOfRange_Index, System.SR.ArgumentOutOfRange_IndexCountBuffer, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.byteCount, System.byteIndex, System.bytes, System.charCount, System.charIndex, System.chars, and System.Text.UnicodeEncoding.GetChars().

Referenced by System.Text.UnicodeEncoding.GetChars(), and System.Text.UnicodeEncoding.GetChars().