DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Static Public Member Functions | List of all members
Deveel.Data.Util.StreamExtensions Class Reference

Static Public Member Functions

static void CopyTo (this Stream source, Stream destination)
 
static void CopyTo (this Stream source, Stream destination, int bufferSize)
 

Detailed Description

Definition at line 21 of file StreamExtensions.cs.

Member Function Documentation

static void Deveel.Data.Util.StreamExtensions.CopyTo ( this Stream  source,
Stream  destination 
)
inlinestatic

Definition at line 22 of file StreamExtensions.cs.

22  {
23  CopyTo(source, destination, 2048);
24  }
static void CopyTo(this Stream source, Stream destination)
static void Deveel.Data.Util.StreamExtensions.CopyTo ( this Stream  source,
Stream  destination,
int  bufferSize 
)
inlinestatic

Definition at line 26 of file StreamExtensions.cs.

26  {
27  if (source == null)
28  throw new ArgumentNullException("source");
29  if (destination == null)
30  throw new ArgumentNullException("destination");
31 
32  if (!source.CanRead)
33  throw new ArgumentException("The source stream cannot be read.");
34  if (!destination.CanWrite)
35  throw new ArgumentException("The destination stream cannot be write");
36 
37  var buffer = new byte[bufferSize];
38  int readCount;
39 
40  while ((readCount = source.Read(buffer, 0, bufferSize)) != 0) {
41  destination.Write(buffer, 0, readCount);
42  }
43  }

The documentation for this class was generated from the following file: