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

◆ GetBytes() [8/9]

unsafe override int System.Text.UTF7Encoding.GetBytes ( string s,
int charIndex,
int charCount,
byte[] bytes,
int byteIndex )
inlinevirtual

Reimplemented from System.Text.Encoding.

Definition at line 295 of file UTF7Encoding.cs.

296 {
297 if (s == null || bytes == null)
298 {
299 throw new ArgumentNullException((s == null) ? "s" : "bytes", SR.ArgumentNull_Array);
300 }
301 if (charIndex < 0 || charCount < 0)
302 {
303 throw new ArgumentOutOfRangeException((charIndex < 0) ? "charIndex" : "charCount", SR.ArgumentOutOfRange_NeedNonNegNum);
304 }
305 if (s.Length - charIndex < charCount)
306 {
307 throw new ArgumentOutOfRangeException("s", SR.ArgumentOutOfRange_IndexCount);
308 }
309 if (byteIndex < 0 || byteIndex > bytes.Length)
310 {
311 throw new ArgumentOutOfRangeException("byteIndex", SR.ArgumentOutOfRange_Index);
312 }
313 int byteCount = bytes.Length - byteIndex;
314 fixed (char* ptr = s)
315 {
316 fixed (byte* ptr2 = &MemoryMarshal.GetReference<byte>(bytes))
317 {
318 return GetBytes(ptr + charIndex, charCount, ptr2 + byteIndex, byteCount, null);
319 }
320 }
321 }
unsafe override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)

References System.SR.ArgumentNull_Array, System.SR.ArgumentOutOfRange_Index, System.SR.ArgumentOutOfRange_IndexCount, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.byteCount, System.byteIndex, System.bytes, System.charCount, System.charIndex, System.Text.UTF7Encoding.GetBytes(), and System.s.

Referenced by System.Text.UTF7Encoding.GetByteCount(), System.Text.UTF7Encoding.GetBytes(), System.Text.UTF7Encoding.GetBytes(), and System.Text.UTF7Encoding.GetBytes().