Java InputStream to OutputStream copyStream(InputStream in, OutputStream out)

Here you can find the source of copyStream(InputStream in, OutputStream out)

Description

copy Stream

License

Open Source License

Declaration

public static void copyStream(InputStream in, OutputStream out) throws IOException 

Method Source Code


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

import java.io.*;

public class Main {
    private static final byte[] BUFFER = new byte[64 * 1024];

    public static void copyStream(InputStream in, OutputStream out) throws IOException {
        while (true) {
            int read = in.read(BUFFER);
            if (read < 0)
                break;
            out.write(BUFFER, 0, read);/*from  w  ww  .jav  a  2 s  .c om*/
        }
    }
}

Related

  1. copyStream(InputStream in, File outputFile)
  2. copyStream(InputStream in, FileOutputStream out, IProgressMonitor monitor, int length)
  3. copyStream(InputStream in, OutputStream os)
  4. copyStream(InputStream in, OutputStream os)
  5. copyStream(InputStream in, OutputStream out)
  6. copyStream(InputStream in, OutputStream out)
  7. copyStream(InputStream in, OutputStream out)
  8. copyStream(InputStream in, OutputStream out)
  9. copyStream(InputStream in, OutputStream out)