-
Notifications
You must be signed in to change notification settings - Fork 16
/
Stream.cs
78 lines (66 loc) · 1.57 KB
/
Stream.cs
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
// Copyright (c) 2006, 2007 by Hugh Pyle, inguzaudio.com
namespace DSPUtil
{
/// <summary>
/// Slightly seekable stream (circular buffer)
/// </summary>
class ButteredStream : Stream
{
Stream _s;
public ButteredStream(Stream s)
{
_s = s;
}
public override bool CanRead
{
get { return _s.CanRead; }
}
public override bool CanSeek
{
get { return _s.CanSeek; }
}
public override bool CanWrite
{
get { return _s.CanWrite; }
}
public override void Flush()
{
_s.Flush();
}
public override long Length
{
get { return _s.Length; }
}
public override long Position
{
get
{
return _s.Position;
}
set
{
_s.Position = value;
}
}
public override int Read(byte[] buffer, int offset, int count)
{
return _s.Read(buffer, offset, count);
}
public override long Seek(long offset, SeekOrigin origin)
{
return _s.Seek(offset, origin);
}
public override void SetLength(long value)
{
_s.SetLength(value);
}
public override void Write(byte[] buffer, int offset, int count)
{
_s.Write(buffer, offset, count);
}
}
}