List of utility methods to do InputStream to OutputStream
void | inputStreamToOutputStream(final InputStream in, final OutputStream out) Copy an input stream completely to an output stream. byte[] buffer = null; boolean streaming = true; while (streaming) { buffer = new byte[CHUNK_SIZE]; final int count = in.read(buffer); if (count == -1) { streaming = false; } else { ... |
long | inputStreamToOutputStream(final InputStream in, final OutputStream out, int buffer) Copies the content of an InputStream to an OutputStream .
if (buffer < 1) buffer = DEFAULT_BUFFER; final byte[] byteBuffer = new byte[buffer]; long count = 0; int n = 0; while ((n = in.read(byteBuffer)) != -1) { out.write(byteBuffer, 0, n); count += n; ... |
void | inputStreamToOutputStream(final InputStream inputStream, final OutputStream outputStream) input Stream To Output Stream try { final byte[] buf = new byte[1024]; int length; while ((length = inputStream.read(buf)) > 0) { outputStream.write(buf, 0, length); } catch (final Exception e) { throw new RuntimeException(e); ... |
void | inputStreamToOutputStream(InputStream inStream, OutputStream outStream) input Stream To Output Stream PrintWriter printWritter = new PrintWriter(new OutputStreamWriter(outStream)); BufferedReader bufReader = new BufferedReader(new InputStreamReader(inStream)); String line; while ((line = bufReader.readLine()) != null) { printWritter.println(line); printWritter.flush(); |
void | inputStreamToOutputStream(InputStream is, OutputStream os) copy of an inputstream to corresponding outputStream be carefull on using this method byte[] buf = new byte[8192]; int len = is.read(buf); while (len >= 0) { os.write(buf, 0, len); os.flush(); len = is.read(buf); is.close(); ... |