phelps.io

Class Streams

public class Streams extends Object

Utility methods for java.io.InputStreams and java.io.OutputStreams.

Version: $Revision: 1.3 $ $Date: 2003/08/17 14:25:47 $

Method Summary
static longcopy(InputStream in, OutputStream out)
Convenience method for copy(in, out, false).
static longcopy(InputStream in, OutputStream out, boolean fclose)
static longcopy(InputStream in, OutputStream out, boolean fclose, int length)
Copy contents of in to out.

Method Detail

copy

public static long copy(InputStream in, OutputStream out)
Convenience method for copy(in, out, false).

copy

public static long copy(InputStream in, OutputStream out, boolean fclose)

copy

public static long copy(InputStream in, OutputStream out, boolean fclose, int length)
Copy contents of in to out. If fclose is true then close both streams, so a stream-to-stream copy is as simple as copy(new InputStream(), new OutputStream(), true).

Returns: number of bytes copied