code: public long writeLogTo(long start, OutputStream out) throws IOException {
          CountingOutputStream os = new CountingOutputStream(out);
  
          Session f = source.open();
          f.skip(start);
  
          if(completed) {
              // write everything till EOF
              byte[] buf = new byte[1024];
              int sz;
              while((sz=f.read(buf))>=0)
                  os.write(buf,0,sz);
          } else {
              ByteBuf buf = new ByteBuf(null,f);
              HeadMark head = new HeadMark(buf);
              TailMark tail = new TailMark(buf);
              buf = null;
  
              int readLines = 0;
              while(tail.moveToNextLine(f) && readLines++ < MAX_LINES_READ) {
                  head.moveTo(tail,os);
              }
              head.finish(os);
          }
  
          f.close();
          os.flush();
  
          return os.getByteCount()+start;
      }
docs: Writes the tail portion of the file to the {@link OutputStream}.
  
  @param start
  The byte offset in the input file where the write operation starts.
  
  @return
  if the file is still being written, this method writes the file
  until the last newline character and returns the offset to start
  the next write operation.
  @throws EOFException if the start position is larger than the file size