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

◆ Convert() [4/5]

unsafe override void System.Text.EncoderNLS.Convert ( char[] chars,
int charIndex,
int charCount,
byte[] bytes,
int byteIndex,
int byteCount,
bool flush,
out int charsUsed,
out int bytesUsed,
out bool completed )
inlinevirtualinherited

Reimplemented from System.Text.Encoder.

Definition at line 163 of file EncoderNLS.cs.

164 {
165 if (chars == null || bytes == null)
166 {
167 throw new ArgumentNullException((chars == null) ? "chars" : "bytes", System.SR.ArgumentNull_Array);
168 }
169 if (charIndex < 0 || charCount < 0)
170 {
171 throw new ArgumentOutOfRangeException((charIndex < 0) ? "charIndex" : "charCount", System.SR.ArgumentOutOfRange_NeedNonNegNum);
172 }
173 if (byteIndex < 0 || byteCount < 0)
174 {
175 throw new ArgumentOutOfRangeException((byteIndex < 0) ? "byteIndex" : "byteCount", System.SR.ArgumentOutOfRange_NeedNonNegNum);
176 }
177 if (chars.Length - charIndex < charCount)
178 {
179 throw new ArgumentOutOfRangeException("chars", System.SR.ArgumentOutOfRange_IndexCountBuffer);
180 }
181 if (bytes.Length - byteIndex < byteCount)
182 {
183 throw new ArgumentOutOfRangeException("bytes", System.SR.ArgumentOutOfRange_IndexCountBuffer);
184 }
185 if (chars.Length == 0)
186 {
187 chars = new char[1];
188 }
189 if (bytes.Length == 0)
190 {
191 bytes = new byte[1];
192 }
193 fixed (char* ptr = &chars[0])
194 {
195 fixed (byte* ptr2 = &bytes[0])
196 {
197 Convert(ptr + charIndex, charCount, ptr2 + byteIndex, byteCount, flush, out charsUsed, out bytesUsed, out completed);
198 }
199 }
200 }
static string ArgumentOutOfRange_IndexCountBuffer
Definition SR.cs:78
Definition SR.cs:7
unsafe override void Convert(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex, int byteCount, bool flush, out int charsUsed, out int bytesUsed, out bool completed)

References System.SR.ArgumentNull_Array, System.SR.ArgumentOutOfRange_IndexCountBuffer, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.byteCount, System.byteIndex, System.bytes, System.charCount, System.charIndex, System.chars, System.Text.EncoderNLS.Convert(), and System.Runtime.Serialization.Dictionary.