// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ------------------------------------------------------------------------------ // Changes to this file must follow the http://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System { public readonly ref struct ReadOnlySpan { public static ReadOnlySpan Empty { get { throw null; } } public ReadOnlySpan(T[] array) { throw null;} public ReadOnlySpan(T[] array, int start, int length) { throw null;} public unsafe ReadOnlySpan(void* pointer, int length) { throw null;} public bool IsEmpty { get { throw null; } } public T this[int index] { get { throw null; }} public int Length { get { throw null; } } public void CopyTo(Span destination) { } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public static ReadOnlySpan DangerousCreate(object obj, ref T objectData, int length) { throw null; } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public ref T DangerousGetPinnableReference() { throw null; } #pragma warning disable 0809 //warning CS0809: Obsolete member 'Span.Equals(object)' overrides non-obsolete member 'object.Equals(object)' [System.ObsoleteAttribute("Equals() on ReadOnlySpan will always throw an exception. Use == instead.")] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ObsoleteAttribute("GetHashCode() on ReadOnlySpan will always throw an exception.")] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } #pragma warning restore 0809 public static bool operator ==(ReadOnlySpan left, ReadOnlySpan right) { throw null; } public static implicit operator ReadOnlySpan (T[] array) { throw null; } public static implicit operator ReadOnlySpan (ArraySegment arraySegment) { throw null; } public static bool operator !=(ReadOnlySpan left, ReadOnlySpan right) { throw null; } public ReadOnlySpan Slice(int start) { throw null; } public ReadOnlySpan Slice(int start, int length) { throw null; } public T[] ToArray() { throw null; } public bool TryCopyTo(Span destination) { throw null; } } public readonly ref struct Span { public static Span Empty { get { throw null; } } public Span(T[] array) { throw null;} public Span(T[] array, int start, int length) { throw null;} public unsafe Span(void* pointer, int length) { throw null;} public bool IsEmpty { get { throw null; } } public ref T this[int index] { get { throw null; } } public int Length { get { throw null; } } public void Clear() { } public void Fill(T value) { } public void CopyTo(Span destination) { } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public static Span DangerousCreate(object obj, ref T objectData, int length) { throw null; } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public ref T DangerousGetPinnableReference() { throw null; } #pragma warning disable 0809 //warning CS0809: Obsolete member 'Span.Equals(object)' overrides non-obsolete member 'object.Equals(object)' [System.ObsoleteAttribute("Equals() on Span will always throw an exception. Use == instead.")] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ObsoleteAttribute("GetHashCode() on Span will always throw an exception.")] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } #pragma warning restore 0809 public static bool operator ==(Span left, Span right) { throw null; } public static implicit operator Span (T[] array) { throw null; } public static implicit operator Span (ArraySegment arraySegment) { throw null; } public static implicit operator ReadOnlySpan (Span span) { throw null; } public static bool operator !=(Span left, Span right) { throw null; } public Span Slice(int start) { throw null; } public Span Slice(int start, int length) { throw null; } public T[] ToArray() { throw null; } public bool TryCopyTo(Span destination) { throw null; } } public static class SpanExtensions { public static int IndexOf(this Span span, T value) where T:struct, IEquatable { throw null; } public static int IndexOf(this Span span, ReadOnlySpan value) where T : struct, IEquatable { throw null; } public static int IndexOf(this Span span, byte value) { throw null; } public static int IndexOf(this Span span, ReadOnlySpan value) { throw null; } public static int IndexOfAny(this Span span, byte value0, byte value1) { throw null; } public static int IndexOfAny(this Span span, byte value0, byte value1, byte value2) { throw null; } public static int IndexOfAny(this Span span, ReadOnlySpan values) { throw null; } public static bool SequenceEqual(this Span first, ReadOnlySpan second) where T:struct, IEquatable { throw null; } public static bool SequenceEqual(this Span first, ReadOnlySpan second) { throw null; } public static bool StartsWith(this Span span, ReadOnlySpan value) where T : struct, IEquatable { throw null; } public static bool StartsWith(this Span span, ReadOnlySpan value) { throw null; } public static Span AsBytes(this Span source) where T : struct { throw null; } public static Span NonPortableCast(this Span source) where TFrom : struct where TTo : struct { throw null; } public static ReadOnlySpan AsReadOnlySpan(this string text) { throw null; } public static Span AsSpan(this T[] array) { throw null; } public static Span AsSpan(this ArraySegment arraySegment) { throw null; } public static ReadOnlySpan AsReadOnlySpan(this T[] array) { throw null; } public static ReadOnlySpan AsReadOnlySpan(this ArraySegment arraySegment) { throw null; } public static void CopyTo(this T[] array, Span destination) { throw null; } public static int IndexOf(this ReadOnlySpan span, T value) where T : struct, IEquatable { throw null; } public static int IndexOf(this ReadOnlySpan span, ReadOnlySpan value) where T : struct, IEquatable { throw null; } public static int IndexOf(this ReadOnlySpan span, byte value) { throw null; } public static int IndexOf(this ReadOnlySpan span, ReadOnlySpan value) { throw null; } public static int IndexOfAny(this ReadOnlySpan span, byte value0, byte value1) { throw null; } public static int IndexOfAny(this ReadOnlySpan span, byte value0, byte value1, byte value2) { throw null; } public static int IndexOfAny(this ReadOnlySpan span, ReadOnlySpan values) { throw null; } public static bool SequenceEqual(this ReadOnlySpan first, ReadOnlySpan second) where T : struct, IEquatable { throw null; } public static bool SequenceEqual(this ReadOnlySpan first, ReadOnlySpan second) { throw null; } public static bool StartsWith(this ReadOnlySpan span, ReadOnlySpan value) where T : struct, IEquatable { throw null; } public static bool StartsWith(this ReadOnlySpan span, ReadOnlySpan value) { throw null; } public static ReadOnlySpan AsBytes(this ReadOnlySpan source) where T : struct { throw null; } public static ReadOnlySpan NonPortableCast(this ReadOnlySpan source) where TFrom : struct where TTo : struct { throw null; } } public struct ReadOnlyMemory { public static ReadOnlyMemory Empty { get { throw null; } } public ReadOnlyMemory(T[] array) { throw null;} public ReadOnlyMemory(T[] array, int start, int length) { throw null;} internal ReadOnlyMemory(Buffers.OwnedMemory owner, int index, int length) { throw null;} public bool IsEmpty { get { throw null; } } public int Length { get { throw null; } } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } public bool Equals(ReadOnlyMemory other) { throw null; } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } public static implicit operator ReadOnlyMemory(T[] array) { throw null; } public static implicit operator ReadOnlyMemory(ArraySegment arraySegment) { throw null; } public ReadOnlyMemory Slice(int start) { throw null; } public ReadOnlyMemory Slice(int start, int length) { throw null; } public ReadOnlySpan Span { get { throw null; } } public unsafe Buffers.MemoryHandle Retain(bool pin = false) { throw null; } public T[] ToArray() { throw null; } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool DangerousTryGetArray(out ArraySegment arraySegment) { throw null; } } public struct Memory { public static Memory Empty { get { throw null; } } public Memory(T[] array) { throw null;} public Memory(T[] array, int start, int length) { throw null;} internal Memory(Buffers.OwnedMemory owner, int index, int length) { throw null;} public bool IsEmpty { get { throw null; } } public int Length { get { throw null; } } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } public bool Equals(Memory other) { throw null; } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } public static implicit operator Memory(T[] array) { throw null; } public static implicit operator Memory(ArraySegment arraySegment) { throw null; } public static implicit operator ReadOnlyMemory(Memory memory) { throw null; } public Memory Slice(int start) { throw null; } public Memory Slice(int start, int length) { throw null; } public Span Span { get { throw null; } } public unsafe Buffers.MemoryHandle Retain(bool pin = false) { throw null; } public T[] ToArray() { throw null; } public bool TryGetArray(out ArraySegment arraySegment) { throw null; } } } namespace System.Buffers { public unsafe struct MemoryHandle : IDisposable { public MemoryHandle(IRetainable owner, void* pinnedPointer = null, System.Runtime.InteropServices.GCHandle handle = default(System.Runtime.InteropServices.GCHandle)) { throw null; } public void* PinnedPointer { get { throw null; } } public void Dispose() { throw null; } } public interface IRetainable { bool Release(); void Retain(); } public abstract class OwnedMemory : IDisposable, IRetainable { public Memory Memory { get { throw null; } } public abstract bool IsDisposed { get; } protected abstract bool IsRetained { get; } public abstract int Length { get; } public abstract Span Span { get; } public void Dispose() { throw null; } protected abstract void Dispose(bool disposing); public abstract MemoryHandle Pin(); public abstract bool Release(); public abstract void Retain(); protected internal abstract bool TryGetArray(out ArraySegment arraySegment); } }