byte[] buf = new byte[systemInfo.getBytesPerRead()];
FileOutputStream fos = null;
try {
fos = new FileOutputStream(file);
int count = 0;
while ((count = vfsService.readData(sessionID, fileSessionID, buf, buf.length)) != -1)
{
fos.write(buf, 0, count);
}
} catch (IOException e) {
e.printStackTrace(System.err);