Source/NFX/IOMiscUtils.cs
/// <summary>
/// Copies one stream into another using temp buffer
/// </summary>
Copies one stream into another using temp buffer
Copies one stream into another using temp buffer
public static void CopyStream(Stream from, Stream to, bool noCache = false)
        {
            if (ts_CopyBuffer==null) ts_CopyBuffer = new byte[98*1024];
            int read;
            while((read = from.Read(ts_CopyBuffer, 0, ts_CopyBuffer.Length)) > 0)
                to.Write(ts_CopyBuffer, 0, read);
            if (noCache)
              ts_CopyBuffer = null;
        }
public static void CopyStream ( Stream from , Stream to , bool noCache = false ) { if ( ts_CopyBuffer == null ) ts_CopyBuffer = new byte [ 98 * 1024 ] ; int read ; while ( ( read = from . Read ( ts_CopyBuffer , 0 , ts_CopyBuffer . Length ) ) > 0 ) to . Write ( ts_CopyBuffer , 0 , read ) ; if ( noCache ) ts_CopyBuffer = null ; }
Copies one stream into another using temp buffer
Copies one stream into another using temp buffer
from
Stream
to
Stream
noCache
bool