Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
UnmanagedMemoryStreamWrapper.cs
Go to the documentation of this file.
3
4namespace System.IO;
5
7{
9
10 public override bool CanRead => _unmanagedStream.CanRead;
11
12 public override bool CanSeek => _unmanagedStream.CanSeek;
13
14 public override bool CanWrite => _unmanagedStream.CanWrite;
15
16 public override int Capacity
17 {
18 get
19 {
20 return (int)_unmanagedStream.Capacity;
21 }
22 set
23 {
25 }
26 }
27
28 public override long Length => _unmanagedStream.Length;
29
30 public override long Position
31 {
32 get
33 {
35 }
36 set
37 {
38 _unmanagedStream.Position = value;
39 }
40 }
41
46
47 protected override void Dispose(bool disposing)
48 {
49 try
50 {
51 if (disposing)
52 {
54 }
55 }
56 finally
57 {
58 base.Dispose(disposing);
59 }
60 }
61
62 public override void Flush()
63 {
65 }
66
67 public override byte[] GetBuffer()
68 {
70 }
71
72 public override bool TryGetBuffer(out ArraySegment<byte> buffer)
73 {
74 buffer = default(ArraySegment<byte>);
75 return false;
76 }
77
78 public override int Read(byte[] buffer, int offset, int count)
79 {
81 }
82
83 public override int Read(Span<byte> buffer)
84 {
86 }
87
88 public override int ReadByte()
89 {
91 }
92
93 public override long Seek(long offset, SeekOrigin loc)
94 {
95 return _unmanagedStream.Seek(offset, loc);
96 }
97
98 public override byte[] ToArray()
99 {
100 byte[] array = new byte[_unmanagedStream.Length];
102 return array;
103 }
104
105 public override void Write(byte[] buffer, int offset, int count)
106 {
108 }
109
110 public override void Write(ReadOnlySpan<byte> buffer)
111 {
113 }
114
115 public override void WriteByte(byte value)
116 {
118 }
119
120 public override void WriteTo(Stream stream)
121 {
122 if (stream == null)
123 {
124 throw new ArgumentNullException("stream", SR.ArgumentNull_Stream);
125 }
126 byte[] array = ToArray();
127 stream.Write(array, 0, array.Length);
128 }
129
130 public override void SetLength(long value)
131 {
132 base.SetLength(value);
133 }
134
136 {
137 if (destination == null)
138 {
139 throw new ArgumentNullException("destination");
140 }
141 if (bufferSize <= 0)
142 {
144 }
145 if (!CanRead && !CanWrite)
146 {
148 }
149 if (!destination.CanRead && !destination.CanWrite)
150 {
152 }
153 if (!CanRead)
154 {
156 }
157 if (!destination.CanWrite)
158 {
160 }
162 }
163
168
173
178
183
188}
Task CopyToAsync(Stream destination)
Definition Stream.cs:571
override long Seek(long offset, SeekOrigin loc)
override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
override void Write(byte[] buffer, int offset, int count)
override bool TryGetBuffer(out ArraySegment< byte > buffer)
override ValueTask< int > ReadAsync(Memory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
override int Read(byte[] buffer, int offset, int count)
override void Write(ReadOnlySpan< byte > buffer)
override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
override ValueTask WriteAsync(ReadOnlyMemory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
UnmanagedMemoryStreamWrapper(UnmanagedMemoryStream stream)
override Task FlushAsync(CancellationToken cancellationToken)
override Task< int > ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
unsafe override void WriteByte(byte value)
override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
override long Seek(long offset, SeekOrigin loc)
override int Read(byte[] buffer, int offset, int count)
override void Write(byte[] buffer, int offset, int count)
override Task< int > ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
override Task FlushAsync(CancellationToken cancellationToken)
unsafe override void Dispose(bool disposing)
static string ArgumentOutOfRange_NeedPosNum
Definition SR.cs:20
static string ArgumentNull_Stream
Definition SR.cs:958
static string UnauthorizedAccess_MemStreamBuffer
Definition SR.cs:2024
static string IO_FixedCapacity
Definition SR.cs:1572
Definition SR.cs:7
static void ThrowNotSupportedException_UnwritableStream()
static void ThrowObjectDisposedException_StreamClosed(string objectName)
static void ThrowNotSupportedException_UnreadableStream()