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

◆ GetChars() [4/6]

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

Definition at line 257 of file EncodingNLS.cs.

258 {
259 if (bytes == null || chars == null)
260 {
261 throw new ArgumentNullException((bytes == null) ? "bytes" : "chars", System.SR.ArgumentNull_Array);
262 }
263 if (byteIndex < 0 || byteCount < 0)
264 {
265 throw new ArgumentOutOfRangeException((byteIndex < 0) ? "byteIndex" : "byteCount", System.SR.ArgumentOutOfRange_NeedNonNegNum);
266 }
267 if (bytes.Length - byteIndex < byteCount)
268 {
269 throw new ArgumentOutOfRangeException("bytes", System.SR.ArgumentOutOfRange_IndexCountBuffer);
270 }
271 if (charIndex < 0 || charIndex > chars.Length)
272 {
273 throw new ArgumentOutOfRangeException("charIndex", System.SR.ArgumentOutOfRange_Index);
274 }
275 if (bytes.Length == 0)
276 {
277 return 0;
278 }
279 int charCount = chars.Length - charIndex;
280 if (chars.Length == 0)
281 {
282 chars = new char[1];
283 }
284 fixed (byte* ptr = &bytes[0])
285 {
286 fixed (char* ptr2 = &chars[0])
287 {
288 return GetChars(ptr + byteIndex, byteCount, ptr2 + charIndex, charCount, null);
289 }
290 }
291 }
static string ArgumentOutOfRange_Index
Definition SR.cs:30
static string ArgumentOutOfRange_IndexCountBuffer
Definition SR.cs:78
Definition SR.cs:7
unsafe int GetChars(byte *bytes, int byteCount, char *chars, int charCount, System.Text.DecoderNLS decoder)

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.EncodingNLS.GetChars().