private int fillBuffer() throws IOException {
if (fileOffset >= fileAttribute.getSize()) {
return 0;
}
ReadFileResult readFileResult;
try {
readFileResult = nfsClient.readFile(fileHandle, (int) fileOffset, DEFAULT_BUFFER_SIZE);
} catch (NFS2Exception e) {
throw new IOException(e.getMessage());
}
fileAttribute = readFileResult.getFileAttribute();
fileOffset += readFileResult.getData().length;
System.arraycopy(readFileResult.getData(), 0, buffer, 0, readFileResult.getData().length);
bufferPosition = 0;
bufferCount = readFileResult.getData().length;
return bufferCount;
}