List of utility methods to do InputStream to OutputStream
long | copyStream(InputStream in, OutputStream out) copy Stream int BUFSIZE = 8192; byte[] buf = new byte[BUFSIZE]; BufferedInputStream bin = new BufferedInputStream(in, BUFSIZE); BufferedOutputStream bout = new BufferedOutputStream(out, BUFSIZE); try { int c; long bytesWritten = 0l; while ((c = bin.read(buf)) != -1) { ... |
int | copyStream(InputStream in, OutputStream out) copy Stream int length = 0; byte[] buffer = new byte[1024]; for (int read = in.read(buffer); read != -1; read = in.read(buffer)) { out.write(buffer, 0, read); length += read; out.flush(); out.close(); ... |
void | copyStream(InputStream in, OutputStream out) Copies streams. in = new BufferedInputStream(in); try { out = new BufferedOutputStream(out); try { while (true) { int data = in.read(); if (data == -1) break; ... |
long | copyStream(InputStream in, OutputStream out) Copies data from one stream to another, until the input stream ends. long total = 0; int len; byte[] buffer = new byte[DEFAULT_READ_BUFFER_SIZE]; while ((len = in.read(buffer)) >= 0) { out.write(buffer, 0, len); total += len; return total; ... |
void | copyStream(InputStream in, OutputStream out) Copy bytes from input to output stream, leaving out stream open if (in == null) { throw new NullPointerException("Input stream is null"); if (out == null) { throw new NullPointerException("Output stream is null"); final byte[] buf = new byte[2048]; int len; ... |
void | copyStream(InputStream in, OutputStream out) copy Stream byte[] buffer = new byte[BUFSIZ]; for (;;) { int size = in.read(buffer); if (size <= 0) break; out.write(buffer, 0, size); |
long | copyStream(InputStream in, OutputStream out) Copies all the data from the specified input stream to the specified output stream. byte[] buffer = new byte[5120]; long bytesCopied = 0; int bytesInBuffer; while ((bytesInBuffer = in.read(buffer)) != -1) { out.write(buffer, 0, bytesInBuffer); bytesCopied += bytesInBuffer; return bytesCopied; ... |
void | copyStream(InputStream in, OutputStream out) copy Stream byte[] buf = new byte[4096]; int len; while ((len = in.read(buf)) != -1) { out.write(buf, 0, len); |
void | copyStream(InputStream in, OutputStream out) Copy stream 'in' to stream 'out'. for (int c; (c = in.read()) != -1;) out.write(c); |
void | copyStream(InputStream in, OutputStream out) Copy the content of one stream to another. byte[] bytes = new byte[1024]; int len; while ((len = in.read(bytes)) != -1) out.write(bytes, 0, len); |