public void CopyTo(IAreaWriter destination, int size) { const int BUFFER_SIZE = 2048; byte[] buf = new byte[BUFFER_SIZE]; int to_copy = System.Math.Min(size, BUFFER_SIZE); while (to_copy > 0) { Read(buf, 0, to_copy); destination.Write(buf, 0, to_copy); size -= to_copy; to_copy = System.Math.Min(size, BUFFER_SIZE); } }
public void CopyTo(IAreaWriter dest, int size) { // NOTE: Assuming 'destination' is a StoreArea, the temporary buffer // could be optimized away to a direct System.arraycopy. However, this // function would need to be written as a lower level IO function. const int BUFFER_SIZE = 2048; byte[] buf = new byte[BUFFER_SIZE]; int to_copy = System.Math.Min(size, BUFFER_SIZE); while (to_copy > 0) { Read(buf, 0, to_copy); dest.Write(buf, 0, to_copy); size -= to_copy; to_copy = System.Math.Min(size, BUFFER_SIZE); } }
public override void WriteTo(IAreaWriter area) { area.Write(data, 0, Length); }
public override void WriteTo(IAreaWriter writer) { writer.Write(buffer, 6, Length); }
public override void WriteTo(IAreaWriter area) { area.Write(data, 12, Length); }
public override void WriteTo(IAreaWriter writer) { writer.Write(data, 0, Length); }