Created
August 5, 2011 09:19
-
-
Save rayyildiz/1127182 to your computer and use it in GitHub Desktop.
Copy stream
This file contains 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
public class StreamHelper{ | |
public static void copy(InputStream in, OutputStream out) throws IOException { | |
byte[] barr = new byte[1024]; | |
while(true) { | |
int r = in.read(barr); | |
if (r <= 0) { | |
break; | |
} | |
out.write(barr, 0, r); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment