I am using Apache Commons FTPClient to upload large files, but the transfer speed is only a fraction of transfer speed using WinSCP via FTP. How can I speed up my transfer?<
use the outputStream method, and transfer with a buffer.
InputStream inputStream = new FileInputStream(myFile);
OutputStream outputStream = ftpclient.storeFileStream(remoteFile);
byte[] bytesIn = new byte[4096];
int read = 0;
while((read = inputStream.read(bytesIn)) != -1) {
outputStream.write(bytesIn, 0, read);
}
inputStream.close();
outputStream.close();