Java Dump Stream dump(InputStream inputStream, OutputStream out)

Here you can find the source of dump(InputStream inputStream, OutputStream out)

Description

dump

License

Open Source License

Declaration

private static long dump(InputStream inputStream, OutputStream out)
            throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    private static long dump(InputStream inputStream, OutputStream out)
            throws IOException {
        long total = 0;
        int read;
        int bufferSize = 8192;
        byte[] buffer = new byte[bufferSize];
        while ((read = inputStream.read(buffer, 0, bufferSize)) > -1) {
            out.write(buffer, 0, read);// w  w  w .jav a  2  s  . c om
            total += read;
        }
        out.flush();
        return total;
    }
}

Related

  1. dump(final InputStream input)
  2. dump(InputStream is, File to)
  3. dump(PrintStream p, String indent, String s)
  4. dumparr(Object[] arr, PrintStream out, boolean term)
  5. dumpArray(PrintStream out, Object[] array)