| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using System.IO; |
| | 6 | |
|
| | 7 | | namespace Azure.Core.Pipeline |
| | 8 | | { |
| | 9 | | internal abstract class ReadOnlyStream : Stream |
| | 10 | | { |
| 0 | 11 | | public override bool CanWrite => false; |
| | 12 | |
|
| | 13 | | public override void Write(byte[] buffer, int offset, int count) |
| | 14 | | { |
| 0 | 15 | | throw new NotSupportedException(); |
| | 16 | | } |
| | 17 | |
|
| | 18 | | public override void SetLength(long value) |
| | 19 | | { |
| 0 | 20 | | throw new NotSupportedException(); |
| | 21 | | } |
| | 22 | |
|
| | 23 | | public override void Flush() |
| | 24 | | { |
| | 25 | | // Flush is allowed on read-only stream |
| 0 | 26 | | } |
| | 27 | | } |
| | 28 | | } |