forked from NVIDIAGameWorks/UE4GitDepsPacker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWriteStream.cs
87 lines (74 loc) · 1.3 KB
/
WriteStream.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
79
80
81
82
83
84
85
86
87
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace GitDepsPacker
{
class WriteStream : Stream
{
Stream Inner;
long Pos;
public WriteStream(Stream Inner)
{
this.Inner = Inner;
this.Pos = 0;
}
protected override void Dispose(bool Disposing)
{
if (Inner != null)
{
Inner.Dispose();
Inner = null;
}
}
public override bool CanRead
{
get { return false; }
}
public override bool CanWrite
{
get { return true; }
}
public override bool CanSeek
{
get { return false; }
}
public override long Position
{
get
{
return Pos;
}
set
{
throw new NotImplementedException();
}
}
public override long Length
{
get { throw new NotImplementedException(); }
}
public override void SetLength(long Value)
{
throw new NotImplementedException();
}
public override int Read(byte[] Buffer, int Offset, int Count)
{
throw new NotImplementedException();
}
public override void Write(byte[] Buffer, int Offset, int Count)
{
Inner.Write(Buffer, Offset, Count);
Pos += Count;
}
public override long Seek(long Offset, SeekOrigin Origin)
{
throw new NotImplementedException();
}
public override void Flush()
{
Inner.Flush();
}
}
}