if(file.length() > 0){
Method getCleanerMethod;
sun.misc.Cleaner cleaner = null;
try {
getCleanerMethod = byteBuffer.getClass().getMethod("cleaner",
new Class[0]);
getCleanerMethod.setAccessible(true);
cleaner = (sun.misc.Cleaner) getCleanerMethod
.invoke(byteBuffer, new Object[0]);
cleaner.clean();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
原文地址:http://11615681.blog.51cto.com/11605681/1774618