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

◆ ReadContentAsBinHex() [2/3]

override int System.Xml.XmlBaseReader.ReadContentAsBinHex ( byte[] buffer,
int offset,
int count )
inlinevirtualinherited

Reimplemented from System.Xml.XmlReader.

Definition at line 2470 of file XmlBaseReader.cs.

2471 {
2472 if (buffer == null)
2473 {
2474 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("buffer"));
2475 }
2476 if (offset < 0)
2477 {
2478 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", System.SR.ValueMustBeNonNegative));
2479 }
2480 if (offset > buffer.Length)
2481 {
2482 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", System.SR.Format(System.SR.OffsetExceedsBufferSize, buffer.Length)));
2483 }
2484 if (count < 0)
2485 {
2486 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", System.SR.ValueMustBeNonNegative));
2487 }
2488 if (count > buffer.Length - offset)
2489 {
2490 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", System.SR.Format(System.SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));
2491 }
2492 if (count == 0)
2493 {
2494 return 0;
2495 }
2496 return ReadBytes(BinHexEncoding, 1, 2, buffer, offset, Math.Min(count, 512), readContent: true);
2497 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string ValueMustBeNonNegative
Definition SR.cs:296
static string SizeExceedsRemainingBufferSpace
Definition SR.cs:324
static string OffsetExceedsBufferSize
Definition SR.cs:322
Definition SR.cs:7
int ReadBytes(Encoding encoding, int byteBlock, int charBlock, byte[] buffer, int offset, int byteCount, bool readContent)

References System.buffer, System.count, System.Xml.Dictionary, System.SR.Format(), System.Math.Min(), System.offset, System.SR.OffsetExceedsBufferSize, System.Xml.XmlBaseReader.ReadBytes(), System.SR.SizeExceedsRemainingBufferSpace, System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), and System.SR.ValueMustBeNonNegative.