Skip to content

Instantly share code, notes, and snippets.

@rayyildiz
Created August 5, 2011 09:19
Show Gist options
  • Save rayyildiz/1127182 to your computer and use it in GitHub Desktop.
Save rayyildiz/1127182 to your computer and use it in GitHub Desktop.
Copy stream
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