List of utility methods to do OutputStream Write
void | writeStreamToStream(InputStream input, OutputStream output) Send all bytes from the input stream to the output stream. byte[] buffer = new byte[4096]; while (true) { int len = input.read(buffer); if (len == -1) { break; output.write(buffer, 0, len); |
void | writeStreamToStream(InputStream inputStream, OutputStream outputStream) write Stream To Stream BufferedInputStream bis = new BufferedInputStream(inputStream); BufferedOutputStream bos = new BufferedOutputStream(outputStream); try { int i = 0; while ((i = bis.read()) != -1) { bos.write(i); } finally { ... |