3条建议:
1)每次读取后清除缓冲区
while (fc.read(bbf) != -1) { md.update(bbf.array(), 0, bytes); bbf.clear();}2)不要同时关闭fc和fis,这是多余的,关闭fis就足够了。FileInputStream.close API说:
If this stream has an associated channel then the channel is closed as well.
3)如果您想通过使用FileChannel来提高性能
ByteBuffer.allocateDirect(1024);



