Created
February 27, 2020 12:16
-
-
Save matteopic/707821a4cbe49981438901f058e87137 to your computer and use it in GitHub Desktop.
Utilities for java.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
public class IOUtils { | |
public static void copyStream(InputStream is, OutputStream os) throws IOException { | |
byte[] buffer = new byte[512]; | |
int read; | |
while((read = is.read(buffer) )> 0){ | |
os.write(buffer, 0, read); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment