private static final void copy(InputStream in,OutputStream out,int blockSize) throws IOException {
  byte[] buffer=new byte[blockSize];
  int len;
  while ((len=in.read(buffer)) != -1) {
    out.write(buffer,0,len);
  }
}

private static final void copy ( InputStream in , OutputStream out , int blockSize ) throws IOException { byte [ ] buffer = new byte [ blockSize ] ; int len ; while ( ( len = in . read ( buffer ) ) != - 1 ) { out . write ( buffer , 0 , len ) ; } }
copy a inputstream to a outputstream
