inputStreamToHD

public static void inputStreamToHD(InputStream is, String rutaFicheroDestino) throws IOException{
int BUFFER_SIZE = 1024;
FileOutputStream out = new FileOutputStream(rutaFicheroDestino);
byte[] buffer= new byte[BUFFER_SIZE];
int r;
while ((r = is.read(buffer)) > -1 ) {
out.write(buffer, 0, r);
}
out.flush();
out.close();
}