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

◆ Slice() [3/3]

static ReadOnlySpan< byte > System.Formats.Asn1.AsnDecoder.Slice ( ReadOnlySpan< byte > source,
int offset,
int? length )
inlinestaticprivate

Definition at line 337 of file AsnDecoder.cs.

338 {
339 if (!length.HasValue)
340 {
341 return source.Slice(offset);
342 }
343 int value = length.Value;
344 if (value < 0 || source.Length - offset < value)
345 {
346 throw new AsnContentException(System.SR.ContentException_LengthExceedsPayload);
347 }
348 return source.Slice(offset, value);
349 }
static string ContentException_LengthExceedsPayload
Definition SR.cs:62
Definition SR.cs:7

References System.SR.ContentException_LengthExceedsPayload, System.length, System.offset, System.source, and System.value.