Android InputStream Copy CopyStream(InputStream is, OutputStream os)

Here you can find the source of CopyStream(InputStream is, OutputStream os)

Description

Copy Stream

Declaration

public static void CopyStream(InputStream is, OutputStream os) 

Method Source Code

//package com.java2s;
import java.io.InputStream;
import java.io.OutputStream;

public class Main {
    public static void CopyStream(InputStream is, OutputStream os) {
        final int buffer_size = 1024;
        try {//from www  .j a va  2 s . c o m
            byte[] bytes = new byte[buffer_size];
            for (;;) {
                int count = is.read(bytes, 0, buffer_size);
                if (count == -1)
                    break;
                os.write(bytes, 0, count);
            }
        } catch (Exception ex) {
        }
    }
}

Related

  1. copyFile(InputStream in, OutputStream out)
  2. copyFile(InputStream input, OutputStream output)
  3. copyStream(InputStream in, OutputStream out)
  4. writeStream(InputStream input, OutputStream output)
  5. CopyStream(InputStream is, OutputStream os)
  6. copyStream(InputStream src, OutputStream dest)
  7. copyAllBytes(InputStream in, OutputStream out)
  8. copyRAWFile(InputStream inStream, File newfile)
  9. copyRAWFile(InputStream inStream, FileOutputStream outStream)