List of utility methods to do InputStream to OutputStream
boolean | copyStream(InputStream src, OutputStream osstream) copy Stream BufferedOutputStream bos = null; BufferedInputStream bis = null; boolean copied = true; try { bos = new BufferedOutputStream(osstream); bis = new BufferedInputStream(src); byte[] buffer = new byte[MAX_BUFFER_SIZE]; int count; ... |
void | CopyStream(InputStream sSource, OutputStream sTarget) Copy Stream assert (sSource != null && (sTarget != null)); if (sSource == null) throw new IllegalArgumentException("sSource"); if (sTarget == null) throw new IllegalArgumentException("sTarget"); final int nBufSize = 4096; byte[] pbBuf = new byte[nBufSize]; int read; ... |
boolean | copyStream(int bufferSize, InputStream in, OutputStream out, boolean canStop) Copy an input stream to an output stream. byte[] buffer = new byte[bufferSize]; int n; long copied = 0L; while (-1 != (n = in.read(buffer))) { out.write(buffer, 0, n); copied += n; if (canStop && Thread.interrupted()) return false; ... |
java.io.OutputStream | copyStream(java.io.InputStream in, java.io.OutputStream out) Copies all data from 'in' stream to 'out' stream. byte buffer[] = new byte[8192]; int length; try { while ((length = in.read(buffer)) != -1) out.write(buffer, 0, length); } finally { in.close(); return out; |
void | copyStream(java.io.InputStream inputStream, java.io.OutputStream outputStream) copy Stream copyStream(inputStream, outputStream, DEFAULT_BUFFER_SIZE); |
int | copyStream(java.io.InputStream src, java.io.OutputStream dest) Copy an input stream to an output stream. return copyStream(src, dest, Long.MAX_VALUE);
|
void | copyStream(OutputStream out, InputStream in, int bufsz) copy Stream byte[] buf = new byte[bufsz]; int n = 0; while ((n = in.read(buf)) > 0) { out.write(buf, 0, n); |
void | copyStream(OutputStream outStream, InputStream inStream) Copies specified input stream to specified output stream. try { byte[] bytes = new byte[1024]; int count = inStream.read(bytes); while (count > 0) { outStream.write(bytes, 0, count); count = inStream.read(bytes); } catch (IOException e) { ... |
void | copyStream(Reader input, Writer output) Coping data(character type) from input reader to output writer. copyStream(input, output, 4096); |
void | copyStreamAndClose(InputStream is, OutputStream os) Copy input stream to output stream and close them both try { copyStream(is, os); } finally { if (is != null) { try { is.close(); } catch (IOException ignored) { if (os != null) os.close(); |