class TailableFile implements Closeable {

    public int tail(ByteBuffer buffer, FileChangeListener listener, int maxLines) throws IOException {
        int readLines = 0;
        while (readLines < maxLines) {
            FileChannel currentFile = getFileChannel();
            if (currentFile == null || isFullyRead()) {
                return readLines;
            }
            readLines += readFile(buffer, listener, maxLines - readLines, currentFile);
        }
        return readLines;
    }

    public  TailableFile(File file);

}