Java examples for java.io:InputStream Read
write Input Stream To Output Stream
//package com.java2s; import java.io.*; public class Main { public static void writeInputToOutputStream(InputStream inputStream, OutputStream outputStream) throws IOException { try {//from w ww . j a v a 2 s .co m while (true) { int readValue = inputStream.read(); if (readValue < 0) break; outputStream.write(readValue); } } finally { inputStream.close(); } } }