Class Streams
- java.lang.Object
-
- org.elasticsearch.core.internal.io.Streams
-
public class Streams extends Object
Simple utility methods for file and stream copying. All copy methods use a block size of 4096 bytes, and close all affected streams when done.Mainly for use within the framework, but also useful for application code.
-
-
Constructor Summary
Constructors Constructor Description Streams()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longcopy(InputStream in, OutputStream out)Copy the contents of the given InputStream to the given OutputStream.
-
-
-
Method Detail
-
copy
public static long copy(InputStream in, OutputStream out) throws IOException
Copy the contents of the given InputStream to the given OutputStream. Closes both streams when done.- Parameters:
in- the stream to copy fromout- the stream to copy to- Returns:
- the number of bytes copied
- Throws:
IOException- in case of I/O errors
-
-