code: public static void pipe(InputStream is, OutputStream os, int buffersize) throws IOException {
          byte[] buffer = new byte[buffersize];
          while (is.read(buffer) != -1) {
              os.write(buffer);
          }
      }
docs: *
  Writes all lines read from the reader.
  @param is The input stream
  @param os The output stream
  @param buffersize size of the buffer to use
  @throws IOException