[jcifs] Persistent Connection to Copy a File by Pieces

stefani stefani at ccen.ufpb.br
Tue Jun 12 17:27:54 GMT 2007


  I need to copy a big file by pieces, i tryed this:
  Started the SmbFile and  SmbFileOutputStream once in the beginning:

  SmbFile smbFile = new SmbFile("smb://dom;user:pass@host/documents/report.txt");

  SmbFileOutputStream out = new SmbFileOutputStream(smbFile, true);

, and then called a method many times with:

  out.write(data, 0, numberBytesRead);


  It works, but is too slow. Does this way open just one connection? If not,
how can i open just a persistent connection and use it many times? If yes,  i
dont know why it's too slow and even how to get better.

  Does anyone can help me? Thanks in advance!

More information about the jcifs mailing list