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

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

Description

copy Streams

License

Open Source License

Declaration

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

Method Source Code

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

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class Main {
    public static void copyStreams(InputStream in, OutputStream out) throws IOException {
        byte[] b = new byte[8192];
        int r;/* w w w . j a v a 2s . c om*/
        while ((r = in.read(b)) >= 0)
            out.write(b, 0, r);
    }
}

Related

  1. copyStreamPortion(java.io.InputStream inputStream, java.io.OutputStream outputStream, int portionSize, int bufferSize)
  2. copyStreams(final InputStream in, final OutputStream out)
  3. copyStreams(final InputStream input, final OutputStream output)
  4. copyStreams(InputStream from, OutputStream to, int blockSize)
  5. copyStreams(InputStream in, OutputStream out)
  6. copyStreams(InputStream in, OutputStream out)
  7. copyStreams(InputStream in, OutputStream out, int buf)
  8. copyStreams(InputStream input, OutputStream output)
  9. copyStreams(InputStream inputStream, OutputStream outputStream)