Class StreamUtility
This utility class is designed to make System.
Inheritance
Namespace: Cuemon.IO
Assembly: Cuemon.Core.dll
Syntax
public static class StreamUtility
Methods
| Improve this DocCombineStreams(Stream[])
Combines a variable number of streams into one stream.
Declaration
public static Stream CombineStreams(params Stream[] streams)
Parameters
Type | Name | Description |
---|---|---|
System. |
streams | The streams to combine. |
Returns
Type | Description |
---|---|
System. |
A variable number of streams combined into one stream. |
CopyStream(Stream)
Creates and returns a seekable copy of the source System.
Declaration
public static Stream CopyStream(Stream source)
Parameters
Type | Name | Description |
---|---|---|
System. |
source | The source System. |
Returns
Type | Description |
---|---|
System. |
A seekable System. |
CopyStream(Stream, Boolean)
Creates and returns a seekable copy of the source System.
Declaration
public static Stream CopyStream(Stream source, bool leaveStreamOpen)
Parameters
Type | Name | Description |
---|---|---|
System. |
source | The source System. |
System. |
leaveStreamOpen | if |
Returns
Type | Description |
---|---|
System. |
A seekable System. |
CopyStream(Stream, Boolean, Int32)
Creates and returns a seekable copy of the source System.
Declaration
public static Stream CopyStream(Stream source, bool leaveStreamOpen, int bufferSize)
Parameters
Type | Name | Description |
---|---|---|
System. |
source | The source System. |
System. |
leaveStreamOpen | if |
System. |
bufferSize | The size of the buffer. This value must be greater than zero. The default size is 2048. |
Returns
Type | Description |
---|---|
System. |
A seekable System. |
CopyStream(Stream, Stream)
Reads all the bytes from the source
stream and writes them to the destination
stream.
Declaration
public static void CopyStream(Stream source, Stream destination)
Parameters
Type | Name | Description |
---|---|---|
System. |
source | The stream to read the contents from. |
System. |
destination | The stream that will contain the contents of the |
CopyStream(Stream, Stream, Int32)
Reads all the bytes from the source
stream and writes them to the destination
stream, using the specified buffer size of bufferSize
.
Declaration
public static void CopyStream(Stream source, Stream destination, int bufferSize)
Parameters
Type | Name | Description |
---|---|---|
System. |
source | The stream to read the contents from. |
System. |
destination | The stream that will contain the contents of the |
System. |
bufferSize | The size of the buffer. This value must be greater than zero. The default size is 2048. |