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

◆ GetString() [3/4]

unsafe override string System.Text.UnicodeEncoding.GetString ( byte[] bytes,
int index,
int count )
inlinevirtual

Reimplemented from System.Text.Encoding.

Definition at line 319 of file UnicodeEncoding.cs.

320 {
321 if (bytes == null)
322 {
323 throw new ArgumentNullException("bytes", SR.ArgumentNull_Array);
324 }
325 if (index < 0 || count < 0)
326 {
327 throw new ArgumentOutOfRangeException((index < 0) ? "index" : "count", SR.ArgumentOutOfRange_NeedNonNegNum);
328 }
329 if (bytes.Length - index < count)
330 {
331 throw new ArgumentOutOfRangeException("bytes", SR.ArgumentOutOfRange_IndexCountBuffer);
332 }
333 if (count == 0)
334 {
335 return string.Empty;
336 }
337 fixed (byte* ptr = bytes)
338 {
339 return string.CreateStringFromEncoding(ptr + index, count, this);
340 }
341 }

References System.SR.ArgumentNull_Array, System.SR.ArgumentOutOfRange_IndexCountBuffer, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.bytes, System.count, and System.index.

Referenced by System.Xml.XmlConverter.ToStringUnicode().