| File: Internal\Infrastructure\ReadOnlyStream.cs | Web Access |
| Project: src\aspnetcore\src\Servers\Kestrel\Core\src\Microsoft.AspNetCore.Server.Kestrel.Core.csproj (Microsoft.AspNetCore.Server.Kestrel.Core) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; internal abstract class ReadOnlyStream : Stream { public override bool CanRead => true; public override bool CanWrite => false; public override int WriteTimeout { get => throw new NotSupportedException(); set => throw new NotSupportedException(); } public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException(); public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => throw new NotSupportedException(); public override ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken) => throw new NotSupportedException(); }