-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInfinityStream.cs
More file actions
46 lines (38 loc) · 1.14 KB
/
InfinityStream.cs
File metadata and controls
46 lines (38 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.IO;
namespace Streams.Compression
{
public class InfinityStream : Stream
{
public override void Flush()
{
}
public override int Read(byte[] buffer, int offset, int count)
{
for (var i = offset; i < offset + count; ++i)
buffer[i] = 1;
return count;
}
public override long Seek(long offset, SeekOrigin origin)
{
throw new NotSupportedException();
}
public override void SetLength(long value)
{
throw new NotSupportedException();
}
public override void Write(byte[] buffer, int offset, int count)
{
throw new NotSupportedException();
}
public override bool CanRead => true;
public override bool CanSeek => false;
public override bool CanWrite => false;
public override long Length => throw new NotSupportedException();
public override long Position
{
get => throw new NotSupportedException();
set => throw new NotSupportedException();
}
}
}