JCIFS: file retrieval is too slow to be usable

后端 未结 7 1514
北海茫月
北海茫月 2020-12-05 05:57

I was just testing JCIFS for accessing Windows shares. It is very slow to the point of being completely unusable.

import jcifs.smb.*;

class First {
    publ         


        
7条回答
  •  一个人的身影
    2020-12-05 06:13

    I found somewhere that SmbFileInputStream doesn't do its own buffering and hence the reason for being slow. Wrapping SmbFileInputStream in a BufferedInputStream solved the problem.

     SmbFile sFile = new SmbFile(path, authentication);
    
     BufferedInputStream buf = new BufferedInputStream(new SmbFileInputStream(sFile));
    

提交回复
热议问题