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

◆ GetBytes() [8/9]

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

Reimplemented from System.Text.Encoding.

Definition at line 148 of file UTF32Encoding.cs.

149 {
150 if (s == null || bytes == null)
151 {
152 throw new ArgumentNullException((s == null) ? "s" : "bytes", SR.ArgumentNull_Array);
153 }
154 if (charIndex < 0 || charCount < 0)
155 {
156 throw new ArgumentOutOfRangeException((charIndex < 0) ? "charIndex" : "charCount", SR.ArgumentOutOfRange_NeedNonNegNum);
157 }
158 if (s.Length - charIndex < charCount)
159 {
160 throw new ArgumentOutOfRangeException("s", SR.ArgumentOutOfRange_IndexCount);
161 }
162 if (byteIndex < 0 || byteIndex > bytes.Length)
163 {
164 throw new ArgumentOutOfRangeException("byteIndex", SR.ArgumentOutOfRange_Index);
165 }
166 int byteCount = bytes.Length - byteIndex;
167 fixed (char* ptr = s)
168 {
169 fixed (byte* ptr2 = &MemoryMarshal.GetReference<byte>(bytes))
170 {
171 return GetBytes(ptr + charIndex, charCount, ptr2 + byteIndex, byteCount, null);
172 }
173 }
174 }
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.UTF32Encoding.GetBytes(), and System.s.

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