public static void writeFile(InputStream inStream,OutputStream outStream) throws IOException {
  try {
    byte[] buf=new byte[BUFF_SIZE];
    int len=inStream.read(buf);
    while (len > 0) {
      outStream.write(buf,0,len);
      len=inStream.read(buf);
    }
  }
  finally {
    if (inStream != null) {
      inStream.close();
    }
    if (outStream != null) {
      outStream.close();
    }
  }
}

public static void writeFile ( InputStream inStream , OutputStream outStream ) throws IOException { try { byte [ ] buf = new byte [ BUFF_SIZE ] ; int len = inStream . read ( buf ) ; while ( len > 0 ) { outStream . write ( buf , 0 , len ) ; len = inStream . read ( buf ) ; } } finally { if ( inStream != null ) { inStream . close ( ) ; } if ( outStream != null ) { outStream . close ( ) ; } } }
method writes contents of file .
