Mono.Rocks.Check.Destination C# (CSharp) Method

Destination() public static method

public static Destination ( object destination ) : void
destination object
return void
        public static void Destination(object destination)
        {
            if (destination == null)
                throw new ArgumentNullException ("destination");
        }

Usage Example

Beispiel #1
0
        public static void WriteTo(this Stream self, Stream destination)
        {
            Check.Self(self);
            Check.Destination(destination);

            int size = self.CanSeek
                                ? (int)System.Math.Min(self.Length - self.Position, 4096)
                                : 4096;

            byte[] buf = new byte [size];
            int    r;

            while ((r = self.Read(buf, 0, buf.Length)) > 0)
            {
                destination.Write(buf, 0, r);
            }
        }