InputStream lastRevision = af.extractLastRevision(name);
ByteArrayOutputStream out = new ByteArrayOutputStream();
int bufSize = 1024;
byte buf[] = new byte[bufSize];
int len = 0;
while (-1 != (len = lastRevision.read(buf, 0, bufSize))) {
out.write(buf, 0, len);
}
reader.close(); //这边关一下读取filePath这个文件的pdfreader,不然文件处于打开状态,无法new FileOutputStream(filePath)
byte[] buf2 = out.toByteArray();
FileOutputStream fos = new FileOutputStream(filePath);
fos.write(buf2, 0, buf2.length);
fos.flush();
fos.close();