Skip to content

Add Stream Span/Buffer-based APIs #22820

@stephentoub

Description

@stephentoub

Separated out of https://github.com/dotnet/corefx/issues/21281 for tracking purposes.

  • Implement span-based APIs in System.Private.CoreLib in coreclr
  • Implement buffer-based APIs in System.Private.CoreLib in coreclr
  • Implement span-based APIs in System.Private.CoreLib in corert (if Stream isn't yet in "shared")
  • Implement buffer-based APIs in System.Private.CoreLib in corert (if Stream isn't yet in "shared")
  • Expose span-based APIs from System.Runtime contract in corefx
  • Expose buffer-based APIs from System.Runtime contract in corefx
  • Add span-based APIs tests to System.Runtime tests in corefx
  • Add buffer-based APIs tests to System.Runtime tests in corefx
namespace System.IO
{
    public class Stream
    {
        public virtual int Read(Span<byte> destination);
        public virtual ValueTask<int> ReadAsync(Buffer<byte> destination, CancellationToken cancellationToken = default(CancellationToken));

        public virtual void Write(ReadOnlySpan<byte> source);
        public virtual Task WriteAsync(ReadOnlyBuffer<byte> source, CancellationToken cancellationToken = default(CancellationToken));}
}

Metadata

Metadata

Assignees

Labels

api-approvedAPI was approved in API review, it can be implementedarea-System.IO

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions