Click or drag to resize

SpanT Structure

Compatibility shim of SpanT for .NET Framework targets.

This type is provided solely to allow JCOBridge public APIs that expose SpanT (such as AsWritableSpan and AsWritableSpan) to compile and function correctly on .NET Framework without any external dependency. The implementation is backed by native pointer arithmetic and covers the subset of the API required by JCOBridge consumers.

JCOBridge HPA edition on .NET Framework uses the official System.Span<T> from the System.Memory NuGet package, which provides the full runtime-optimised implementation including SIMD support.

Users targeting .NET 5+ or .NET Standard 2.1 always receive the official runtime type — this shim is never compiled into those targets.

Inheritance Hierarchy
SystemObject
  SystemValueType
    SystemSpanT

Namespace: System
Assembly: C2JBridge (in C2JBridge.dll) Version: 2.6.9.260611-9a148513a79c26cdd7f1dde468f4f9e06ef3bc7e
Syntax
public readonly ref struct Span<T>
where T : struct, new(), Object

Type Parameters

T
The type of elements in the span. Must be an unmanaged type.

The SpanT type exposes the following members.

Constructors
 NameDescription
Public methodSpanT(T) Creates a new SpanT over the entirety of a target array.
Public methodSpanT(Void*, Int32) Creates a new SpanT from a raw pointer and a length.
Public methodSpanT(T, Int32, Int32) Creates a new SpanT that includes a specified number of elements of an array starting at a specified index.
Top
Properties
 NameDescription
Public propertyStatic memberEmptyGets an empty SpanT.
Public propertyIsEmptyGets a value indicating whether this span is empty.
Public propertyItem Gets or sets the element at the specified index.
Top
Methods
 NameDescription
Public methodClear Clears the contents of this span by setting all elements to the default value of T.
Public methodCopyTo Copies the contents of this span into a destination SpanT.
Public methodEquals Not supported. Throws NotSupportedException.
(Overrides ValueTypeEquals(Object))
Obsolete
Public methodFill Fills all elements of this span with the specified value.
Public methodGetEnumeratorReturns an enumerator for this span, enabling foreach support.
Public methodGetHashCode Not supported. Throws NotSupportedException.
(Overrides ValueTypeGetHashCode)
Obsolete
Public methodGetPinnableReference Returns a reference to the first element for use with the fixed statement.
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodSlice(Int32) Forms a slice out of the current span starting at the specified index.
Public methodSlice(Int32, Int32) Forms a slice out of the current span starting at the specified index for the specified length.
Public methodToArray Copies the contents of this span into a new array.
Public methodToString Returns the string representation of this SpanT.
(Overrides ValueTypeToString)
Public methodTryCopyTo Attempts to copy the contents of this span into a destination SpanT and returns a value indicating whether the operation succeeded.
Top
Operators
 NameDescription
Public operatorStatic memberEquality(SpanT, SpanT)Returns a value that indicates whether two SpanT instances are equal.
Public operatorStatic member(ArraySegmentT to SpanT)Implicitly converts an ArraySegmentT to a SpanT.
Public operatorStatic member(T to SpanT)Implicitly converts a T array to a SpanT.
Public operatorStatic member(SpanT to ReadOnlySpanT)Implicitly converts a SpanT to a ReadOnlySpanT.
Public operatorStatic memberInequality(SpanT, SpanT)Returns a value that indicates whether two SpanT instances are not equal.
Top
Fields
 NameDescription
Public fieldLengthGets the number of elements in the span.
Top
Extension Methods
 NameDescription
Public Extension MethodConvertTReturn Converts a generic object
(Defined by JCOBridgeExtensions)
Public Extension MethodToNative Converts a generic input to an object manageable from the JVM
(Defined by JCOBridgeExtensions)
Top
See Also