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

◆ GetCharCount() [6/7]

unsafe override int System.Text.DecoderDBCS.GetCharCount ( byte[] bytes,
int index,
int count,
bool flush )
inlinevirtual

Reimplemented from System.Text.Decoder.

Definition at line 48 of file DecoderDBCS.cs.

49 {
50 if (bytes == null)
51 {
52 throw new ArgumentNullException("bytes", System.SR.ArgumentNull_Array);
53 }
54 if (index < 0 || count < 0)
55 {
56 throw new ArgumentOutOfRangeException((index < 0) ? "index" : "count", System.SR.ArgumentOutOfRange_NeedNonNegNum);
57 }
58 if (bytes.Length - index < count)
59 {
60 throw new ArgumentOutOfRangeException("bytes", System.SR.ArgumentOutOfRange_IndexCountBuffer);
61 }
62 if (count == 0 && (_leftOverLeadByte == 0 || !flush))
63 {
64 return 0;
65 }
66 fixed (byte* ptr = bytes)
67 {
68 Unsafe.SkipInit(out byte b);
69 byte* bytes2 = ((ptr == null) ? (&b) : (ptr + index));
70 return GetCharCount(bytes2, count, flush);
71 }
72 }
static string ArgumentOutOfRange_IndexCountBuffer
Definition SR.cs:78
static string ArgumentNull_Array
Definition SR.cs:24
Definition SR.cs:7
override int GetCharCount(byte[] bytes, int index, int count)

References System.Text.DecoderDBCS._leftOverLeadByte, System.SR.ArgumentNull_Array, System.SR.ArgumentOutOfRange_IndexCountBuffer, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.bytes, System.count, System.Text.DecoderDBCS.GetCharCount(), and System.index.