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

◆ Span

Definition at line 29 of file ReadOnlyMemory.cs.

30 {
31 [MethodImpl(MethodImplOptions.AggressiveInlining)]
32 get
33 {
34 ref T ptr = ref Unsafe.NullRef<T>();
35 int length = 0;
36 object @object = _object;
37 if (@object != null)
38 {
39 if (typeof(T) == typeof(char) && @object.GetType() == typeof(string))
40 {
41 ptr = ref Unsafe.As<char, T>(ref Unsafe.As<string>(@object).GetRawStringData());
42 length = Unsafe.As<string>(@object).Length;
43 }
44 else if (RuntimeHelpers.ObjectHasComponentSize(@object))
45 {
46 ptr = ref MemoryMarshal.GetArrayDataReference(Unsafe.As<T[]>(@object));
47 length = Unsafe.As<T[]>(@object).Length;
48 }
49 else
50 {
51 Span<T> span = Unsafe.As<MemoryManager<T>>(@object).GetSpan();
52 ptr = ref MemoryMarshal.GetReference(span);
53 length = span.Length;
54 }
55 nuint num = (uint)_index & 0x7FFFFFFFu;
56 int length2 = _length;
57 if ((ulong)((long)num + (long)(uint)length2) > (ulong)(uint)length)
58 {
59 ThrowHelper.ThrowArgumentOutOfRangeException();
60 }
61 ptr = ref Unsafe.Add(ref ptr, (IntPtr)(void*)num);
63 }
64 return new ReadOnlySpan<T>(ref ptr, length);
65 }
66 }
static unsafe bool ObjectHasComponentSize(object obj)
static unsafe ref byte GetArrayDataReference(Array array)
readonly object _object

Referenced by System.IO.ReadOnlyMemoryStream.CopyTo(), System.Buffers.BuffersExtensions.CopyToMultiSegment< T >(), System.Security.Cryptography.Asn1.DssParms.Decode(), System.Security.Cryptography.Asn1.ECPrivateKey.Decode(), System.Security.Cryptography.Asn1.PBEParameter.Decode(), System.Security.Cryptography.Asn1.PBES2Params.Decode(), System.Security.Cryptography.Asn1.Pbkdf2Params.Decode(), System.Security.Cryptography.Asn1.Rc2CbcParameters.Decode(), System.Security.Cryptography.Asn1.RSAPrivateKeyAsn.Decode(), System.Security.Cryptography.Asn1.RSAPublicKeyAsn.Decode(), System.Security.Cryptography.Asn1.AlgorithmIdentifierAsn.Decode(), System.Security.Cryptography.X509Certificates.Asn1.CertificateAsn.Decode(), System.Security.Cryptography.Asn1.ECDomainParameters.Decode(), System.Security.Cryptography.Asn1.AlgorithmIdentifierAsn.DecodeCore(), System.Security.Cryptography.Asn1.CurveAsn.DecodeCore(), System.Security.Cryptography.Asn1.ECPrivateKey.DecodeCore(), System.Security.Cryptography.Asn1.EncryptedPrivateKeyInfoAsn.DecodeCore(), System.Security.Cryptography.Asn1.FieldID.DecodeCore(), System.Security.Cryptography.Asn1.PBEParameter.DecodeCore(), System.Security.Cryptography.Asn1.Rc2CbcParameters.DecodeCore(), System.Security.Cryptography.Asn1.SpecifiedECDomain.DecodeCore(), System.Security.Cryptography.Asn1.SubjectPublicKeyInfoAsn.DecodeCore(), System.Security.Cryptography.Asn1.Pbkdf2SaltChoice.DecodeCore(), System.Security.Cryptography.X509Certificates.Asn1.CertificateAsn.DecodeCore(), System.Security.Cryptography.Asn1.AlgorithmIdentifierAsn.DecodeCore(), System.Security.Cryptography.Asn1.CurveAsn.DecodeCore(), System.Security.Cryptography.Asn1.ECPrivateKey.DecodeCore(), System.Security.Cryptography.Asn1.EncryptedPrivateKeyInfoAsn.DecodeCore(), System.Security.Cryptography.Asn1.FieldID.DecodeCore(), System.Security.Cryptography.Asn1.PBEParameter.DecodeCore(), System.Security.Cryptography.Asn1.Rc2CbcParameters.DecodeCore(), System.Security.Cryptography.Asn1.SpecifiedECDomain.DecodeCore(), System.Security.Cryptography.Asn1.SubjectPublicKeyInfoAsn.DecodeCore(), System.Security.Cryptography.Asn1.X509ExtensionAsn.DecodeCore(), System.Security.Cryptography.Asn1.Pbkdf2SaltChoice.DecodeCore(), System.Security.Cryptography.KeyFormatHelper.DecryptPkcs8(), System.Security.Cryptography.Asn1.DirectoryStringAsn.Encode(), System.Security.Cryptography.Asn1.GeneralNameAsn.Encode(), System.Security.Cryptography.Asn1.CurveAsn.Encode(), System.Security.Cryptography.Asn1.FieldID.Encode(), System.Security.Cryptography.Asn1.SpecifiedECDomain.Encode(), System.Security.Cryptography.Asn1.AlgorithmIdentifierAsn.Encode(), System.Security.Cryptography.Asn1.OtherNameAsn.Encode(), System.Security.Cryptography.Asn1.SubjectPublicKeyInfoAsn.Encode(), System.Security.Cryptography.Asn1.X509ExtensionAsn.Encode(), System.Security.Cryptography.X509Certificates.Asn1.CertificateAsn.Encode(), System.Security.Cryptography.X509Certificates.Asn1.CertificationRequestAsn.Encode(), System.Security.Cryptography.X509Certificates.Asn1.CertificationRequestInfoAsn.Encode(), System.Security.Cryptography.X509Certificates.Asn1.TbsCertificateAsn.Encode(), Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.ExecuteInternal(), System.Buffers.SequenceReader< T >.GetNextSpan(), System.Security.Cryptography.EccKeyFormatHelper.GetSpecifiedECCurveCore(), System.Security.Cryptography.EccKeyFormatHelper.GetSpecifiedECCurveCore(), System.Text.Json.JsonDocument.GetString(), System.Numerics.BigNumber.HexNumberToBigInteger(), System.Buffers.SequenceReader< T >.IsNextSlow(), System.IO.Strategies.BufferedFileStreamStrategy._003CWriteAsyncSlowPath_003Ed__50.MoveNext(), System.Numerics.BigNumber.NumberToBigInteger(), System.Security.Cryptography.PasswordBasedEncryption.OpenCipher(), System.Security.Cryptography.PasswordBasedEncryption.OpenCipher(), System.Security.Cryptography.PasswordBasedEncryption.Pbes1Decrypt(), System.Formats.Asn1.AsnReader.PeekContentBytes(), System.Formats.Asn1.AsnReader.PeekEncodedValue(), System.Formats.Asn1.AsnReader.PeekTag(), System.Security.Cryptography.PasswordBasedEncryption.Pkcs12PbeDecrypt(), System.Security.Cryptography.PasswordBasedEncryption.Pkcs12PbeDecrypt(), System.Buffers.BuffersExtensions.PositionOfMultiSegment< T >(), System.Formats.Asn1.AsnReader.ReadBitString(), System.Formats.Asn1.AsnReader.ReadBoolean(), System.IO.ReadOnlyMemoryStream.ReadBuffer(), System.IO.ReadOnlyMemoryStream.ReadByte(), System.Formats.Asn1.AsnReader.ReadCharacterString(), System.Security.Cryptography.DSAKeyFormatHelper.ReadDsaPrivateKey(), System.Security.Cryptography.DSAKeyFormatHelper.ReadDsaPublicKey(), System.Security.Cryptography.KeyFormatHelper.ReadEncryptedPkcs8< TRet >(), System.Formats.Asn1.AsnReader.ReadEnumeratedBytes(), System.Formats.Asn1.AsnReader.ReadEnumeratedValue(), System.Formats.Asn1.AsnReader.ReadEnumeratedValue< TEnum >(), System.Formats.Asn1.AsnReader.ReadGeneralizedTime(), System.Formats.Asn1.AsnReader.ReadInteger(), System.Formats.Asn1.AsnReader.ReadIntegerBytes(), System.Security.Cryptography.PasswordBasedEncryption.ReadIvParameter(), System.Formats.Asn1.AsnReader.ReadNamedBitList(), System.Formats.Asn1.AsnReader.ReadNamedBitListValue(), System.Formats.Asn1.AsnReader.ReadNamedBitListValue< TFlagsEnum >(), System.Formats.Asn1.AsnReader.ReadNull(), System.Formats.Asn1.AsnReader.ReadObjectIdentifier(), System.Formats.Asn1.AsnReader.ReadOctetString(), System.Formats.Asn1.AsnReader.ReadSequence(), System.Formats.Asn1.AsnReader.ReadSetOf(), System.Text.Json.JsonSerializer.ReadUsingMetadata< TValue >(), System.Formats.Asn1.AsnReader.ReadUtcTime(), System.Formats.Asn1.AsnReader.ReadUtcTime(), System.Security.Cryptography.Asn1.AlgorithmIdentifierAsn.RepresentsNull(), System.Net.WebSockets.ManagedWebSocket.SendFrameFallbackAsync(), System.Net.WebSockets.ManagedWebSocket.SendFrameLockAcquiredNonCancelableAsync(), System.Net.Http.ReadOnlyMemoryContent.SerializeToStream(), System.Text.Json.JsonDocument.TextEquals(), System.Security.Cryptography.KeyBlobHelpers.ToUnsignedIntegerBytes(), System.Security.Cryptography.KeyBlobHelpers.ToUnsignedIntegerBytes(), System.Buffers.SequenceReader< T >.TryCopyMultisegment(), System.Text.Json.JsonDocument.TryGetNamedPropertyValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Buffers.SequenceReader< T >.TryPeek(), System.Formats.Asn1.AsnReader.TryReadBitString(), System.Formats.Asn1.AsnReader.TryReadCharacterString(), System.Formats.Asn1.AsnReader.TryReadCharacterStringBytes(), System.Formats.Asn1.AsnReader.TryReadInt32(), System.Formats.Asn1.AsnReader.TryReadInt64(), System.Formats.Asn1.AsnReader.TryReadOctetString(), System.Formats.Asn1.AsnReader.TryReadPrimitiveBitString(), System.Formats.Asn1.AsnReader.TryReadPrimitiveCharacterStringBytes(), System.Formats.Asn1.AsnReader.TryReadPrimitiveOctetString(), System.Formats.Asn1.AsnReader.TryReadUInt32(), System.Formats.Asn1.AsnReader.TryReadUInt64(), System.IO.TextWriter.Write(), System.Text.TranscodingStream.WriteAsync(), System.IO.StreamWriter.WriteFormatHelper(), and System.Text.Json.PooledByteBufferWriter.WriteToStream().