Here you can find the source of saveInputToOutput(InputStream is, OutputStream os)
Parameter | Description |
---|---|
is | a parameter |
os | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static boolean saveInputToOutput(InputStream is, OutputStream os) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Main { /**/* ww w . ja va2s . c om*/ * Save stream from input to output. * * @param is * @param os * @return true if there is no IO exception * @throws IOException */ public static boolean saveInputToOutput(InputStream is, OutputStream os) throws IOException { byte[] buffer = new byte[1024]; int i = -1; while ((i = is.read(buffer)) != -1) { os.write(buffer, 0, i); } os.flush(); return true; } }