2018-01-24 17:04:36 +00:00
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
2018-08-07 15:19:03 +00:00
|
|
|
using System.Runtime.InteropServices;
|
2018-01-24 17:04:36 +00:00
|
|
|
|
|
|
|
namespace System.IO
|
|
|
|
{
|
|
|
|
partial class Stream
|
|
|
|
{
|
|
|
|
public virtual int Read (Span<byte> destination)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException ();
|
|
|
|
}
|
|
|
|
|
2018-01-29 19:03:06 +00:00
|
|
|
public virtual void Write (ReadOnlySpan<byte> source)
|
2018-01-24 17:04:36 +00:00
|
|
|
{
|
|
|
|
throw new NotImplementedException ();
|
|
|
|
}
|
|
|
|
|
2018-08-07 15:19:03 +00:00
|
|
|
public virtual ValueTask<int> ReadAsync (Memory<byte> destination, CancellationToken cancellationToken = default(CancellationToken))
|
2018-01-24 17:04:36 +00:00
|
|
|
{
|
2018-08-07 15:19:03 +00:00
|
|
|
if (MemoryMarshal.TryGetArray (destination, out ArraySegment<byte> array))
|
2018-01-29 19:03:06 +00:00
|
|
|
return new ValueTask<int> (ReadAsync (array.Array, array.Offset, array.Count, cancellationToken));
|
|
|
|
|
2018-01-24 17:04:36 +00:00
|
|
|
throw new NotImplementedException ();
|
|
|
|
}
|
|
|
|
|
2018-08-07 15:19:03 +00:00
|
|
|
public virtual ValueTask WriteAsync (ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default(CancellationToken))
|
2018-01-24 17:04:36 +00:00
|
|
|
{
|
2018-08-07 15:19:03 +00:00
|
|
|
if (MemoryMarshal.TryGetArray (source, out ArraySegment<byte> array))
|
|
|
|
return new ValueTask (WriteAsync (array.Array, array.Offset, array.Count, cancellationToken));
|
|
|
|
|
2018-01-24 17:04:36 +00:00
|
|
|
throw new NotImplementedException ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|