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

◆ GetChars() [4/6]

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

Definition at line 260 of file UTF32Encoding.cs.

261 {
262 if (bytes == null || chars == null)
263 {
264 throw new ArgumentNullException((bytes == null) ? "bytes" : "chars", SR.ArgumentNull_Array);
265 }
266 if (byteIndex < 0 || byteCount < 0)
267 {
268 throw new ArgumentOutOfRangeException((byteIndex < 0) ? "byteIndex" : "byteCount", SR.ArgumentOutOfRange_NeedNonNegNum);
269 }
270 if (bytes.Length - byteIndex < byteCount)
271 {
272 throw new ArgumentOutOfRangeException("bytes", SR.ArgumentOutOfRange_IndexCountBuffer);
273 }
274 if (charIndex < 0 || charIndex > chars.Length)
275 {
276 throw new ArgumentOutOfRangeException("charIndex", SR.ArgumentOutOfRange_Index);
277 }
278 if (byteCount == 0)
279 {
280 return 0;
281 }
282 int charCount = chars.Length - charIndex;
283 fixed (byte* ptr = bytes)
284 {
285 fixed (char* ptr2 = &MemoryMarshal.GetReference<char>(chars))
286 {
287 return GetChars(ptr + byteIndex, byteCount, ptr2 + charIndex, charCount, null);
288 }
289 }
290 }
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.UTF32Encoding.GetChars().

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