Read |
This type is provided solely to allow JCOBridge public APIs that expose ReadOnlySpanT (such as AsSpan and AsSpan) 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.ReadOnlySpan<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.
The ReadOnlySpanT type exposes the following members.
| Name | Description | |
|---|---|---|
| ReadOnlySpanT(T) | Creates a new ReadOnlySpanT over the entirety of a target array. | |
| ReadOnlySpanT(Void*, Int32) | Creates a new ReadOnlySpanT from a raw pointer and a length. |
| Name | Description | |
|---|---|---|
| Empty | Gets an empty ReadOnlySpanT. | |
| IsEmpty | Gets a value indicating whether this span is empty. | |
| Item | Returns the element at the specified index. |
| Name | Description | |
|---|---|---|
| CastUpTDerived |
Not supported on .NET Framework.
CastUp<TDerived> exists for reference-type covariance (e.g. ReadOnlySpan<string> → ReadOnlySpan<object>), which is incompatible with the where T : unmanaged constraint required by this shim. Unmanaged types are never reference types and therefore covariant casting is meaningless in this context. Obsolete | |
| CopyTo(SpanT) | Copies the contents of this span into a destination SpanT. | |
| CopyTo(T, Int32) | Copies the contents of this span into a destination array. | |
| Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType) | |
| GetEnumerator | Returns an enumerator for this span, enabling foreach support. | |
| GetHashCode | Returns the hash code for this instance. (Inherited from ValueType) | |
| GetPinnableReference | Returns a reference to the first element for use with the fixed statement. Not intended to be called by user code. | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| SequenceEqual | Determines whether this span and other contain the same sequence of elements, using a native memcmp comparison. | |
| Slice(Int32) | Forms a slice out of the current span starting at the specified index. | |
| Slice(Int32, Int32) | Forms a slice out of the current span starting at the specified index for the specified length. | |
| ToArray | Copies the contents of this span into a new array. | |
| ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType) | |
| TryCopyTo | Attempts to copy the contents of this span into a destination SpanT and returns a value indicating whether the operation succeeded. |
| Name | Description | |
|---|---|---|
| (T to ReadOnlySpanT) | Implicitly converts a T array to a ReadOnlySpanT. |
| Name | Description | |
|---|---|---|
| ConvertTReturn |
Converts a generic object
(Defined by JCOBridgeExtensions) | |
| ToNative |
Converts a generic input to an object manageable from the JVM
(Defined by JCOBridgeExtensions) |