phelps.io
public class Streams extends Object
Version: $Revision: 1.4 $ $Date: 2003/10/13 06:20:27 $
Method Summary | |
---|---|
static long | copy(InputStream in, OutputStream out) Convenience method for copy(in, out, false) . |
static long | copy(InputStream in, OutputStream out, boolean fclose) |
static long | copy(InputStream in, OutputStream out, boolean fclose, int length)
Copy contents of in to out.
|
copy(in, out, false)
.true
then close both streams,
so a stream-to-stream copy is as simple as copy(new InputStream(), new OutputStream(), true)
.
Neither stream needs to be buffered as block reads and writes are used (which is all that buffered streams do).Returns: number of bytes copied