Class StreamExtensions
Extensions for the System.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Zip.Utilities
Assembly: Telerik.Windows.Zip.dll
Syntax
public static class StreamExtensions
Methods
CopyToAsync(Stream, Stream, CancellationToken)
Asynchronously reads the bytes from the current stream and writes them to another stream. Both streams positions are advanced by the number of bytes copied.
Declaration
public static Task CopyToAsync(this Stream source, Stream destination, CancellationToken cancellationToken)
Parameters
System.
|
System. The stream to which the contents of the current stream will be copied. |
System. The token to monitor for cancellation requests. |
Returns
System. A task that represents the asynchronous copy operation. |
ReadExactly(Stream, Byte[], Int32, Int32)
Reads count
number of bytes from the current stream and advances the position within the stream.
Declaration
public static byte[] ReadExactly(this Stream stream, byte[] buffer, int offset, int count)
Parameters
System. The stream to read from. |
System. An array of bytes. When this method returns, the buffer contains the specified byte array with the values
between |
System. The byte offset in |
System. The number of bytes to be read from the current stream. |
Returns
System.
|
Remarks
When count
is 0 (zero), this read operation will be completed without waiting for available data in the stream.
Exceptions
System.
|
System.
|
System. The end of the stream is reached before reading |