Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CopyToAsync() [4/4]

override Task System.IO.UnmanagedMemoryStreamWrapper.CopyToAsync ( Stream destination,
int bufferSize,
CancellationToken cancellationToken )
inlinevirtual

Reimplemented from System.IO.MemoryStream.

Definition at line 135 of file UnmanagedMemoryStreamWrapper.cs.

136 {
137 if (destination == null)
138 {
139 throw new ArgumentNullException("destination");
140 }
141 if (bufferSize <= 0)
142 {
143 throw new ArgumentOutOfRangeException("bufferSize", SR.ArgumentOutOfRange_NeedPosNum);
144 }
145 if (!CanRead && !CanWrite)
146 {
147 ThrowHelper.ThrowObjectDisposedException_StreamClosed(null);
148 }
149 if (!destination.CanRead && !destination.CanWrite)
150 {
151 ThrowHelper.ThrowObjectDisposedException_StreamClosed("destination");
152 }
153 if (!CanRead)
154 {
155 ThrowHelper.ThrowNotSupportedException_UnreadableStream();
156 }
157 if (!destination.CanWrite)
158 {
159 ThrowHelper.ThrowNotSupportedException_UnwritableStream();
160 }
162 }
Task CopyToAsync(Stream destination)
Definition Stream.cs:571

References System.IO.UnmanagedMemoryStreamWrapper._unmanagedStream, System.SR.ArgumentOutOfRange_NeedPosNum, System.cancellationToken, System.IO.UnmanagedMemoryStreamWrapper.CanRead, System.IO.UnmanagedMemoryStreamWrapper.CanWrite, System.IO.Stream.CopyToAsync(), System.destination, System.ThrowHelper.ThrowNotSupportedException_UnreadableStream(), System.ThrowHelper.ThrowNotSupportedException_UnwritableStream(), and System.ThrowHelper.ThrowObjectDisposedException_StreamClosed().