/**
* 将InputStream写入本地文件
* @param destination 写入本地目录
* @param input 输入流
* @throws IOException
*/
private static void writeToLocal(String destination, InputStream input)
throws IOException {
int index;
byte[] bytes = new byte[1024];
FileOutputStream downloadFile = new FileOutputStream(destination);
while ((index = (bytes)) != -1) {
(bytes, 0, index);
();
}
();
();
}
/**
* 将bytes写入本地文件
* @param destination
* @param bytes
* @throws IOException
*/
private static void writeToLocal(String destination, byte[] bytes)
throws IOException {
FileOutputStream downloadFile = new FileOutputStream(destination);
(bytes);
();
();
}