Skip to content

Instantly share code, notes, and snippets.

@Shaked
Created February 4, 2016 17:21
Show Gist options
  • Select an option

  • Save Shaked/e7c77155cfe6a054dd0f to your computer and use it in GitHub Desktop.

Select an option

Save Shaked/e7c77155cfe6a054dd0f to your computer and use it in GitHub Desktop.
byte[] buffer = new byte[1024];
InputStream reader = new BufferedInputStream(is);
OutputStream writer = new BufferedOutputStream(os);
int read;
while ((read = reader.read(buffer)) != -1) {
writer.write(buffer, 0, read);
}
writer.flush();
writer.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment