39 if (value < 0 || value >
int.MaxValue)
64 long num = origin
switch
66 SeekOrigin.End => _content.Length +
offset,
68 SeekOrigin.Begin =>
offset,
71 if (num >
int.MaxValue)
109 if (num <= 0 ||
buffer.Length == 0)
201 protected override void Dispose(
bool disposing)
205 base.Dispose(disposing);
override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
override int EndRead(IAsyncResult asyncResult)
override void CopyTo(Stream destination, int bufferSize)
ReadOnlyMemoryStream(ReadOnlyMemory< byte > content)
override Task< int > ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
override ValueTask< int > ReadAsync(Memory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
override void Write(byte[] buffer, int offset, int count)
override Task FlushAsync(CancellationToken cancellationToken)
override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
override int Read(Span< byte > buffer)
int ReadBuffer(Span< byte > buffer)
override void SetLength(long value)
override int Read(byte[] buffer, int offset, int count)
ReadOnlyMemory< byte > _content
override void Dispose(bool disposing)
override long Seek(long offset, SeekOrigin origin)
static void ValidateBufferArguments(byte[] buffer, int offset, int count)
static void ValidateCopyToArguments(Stream destination, int bufferSize)
static string ObjectDisposed_StreamClosed
static string IO_SeekBeforeBegin
static IAsyncResult Begin(Task task, AsyncCallback callback, object state)
static void End(IAsyncResult asyncResult)
static Task FromCanceled(CancellationToken cancellationToken)
static Task CompletedTask
unsafe ReadOnlySpan< T > Span
ReadOnlyMemory< T > Slice(int start)
void CopyTo(Span< T > destination)
ReadOnlySpan< T > Slice(int start)
static ValueTask FromCanceled(CancellationToken cancellationToken)