Dwarrowdelf.TerrainGen.TerrainData.CopyTo C# (CSharp) Method

CopyTo() static private method

static private CopyTo ( Stream input, Stream output, int len ) : void
input Stream
output Stream
len int
return void
        static void CopyTo(Stream input, Stream output, int len)
        {
            var arr = new byte[4096 * 8];

            while (len > 0)
            {
                int l = input.Read(arr, 0, Math.Min(len, arr.Length));

                if (l == 0)
                    throw new EndOfStreamException();

                output.Write(arr, 0, l);

                len -= l;
            }
        }