code: @Override
  	public final String readLine() throws IOException {
  
  		String str = null;
  
  		if (buf_end - buf_pos <= 0) {
  			if (fillBuffer() < 0) {
  				// return null if we are at the end and there is nothing to read
  				return null;
  			}
  		}
  
  		int lineend = -1;
  
  		for (int i = buf_pos; i < buf_end; i++) {
  			if (buffer[i] == '\n') {
  				lineend = i;
  				break;
  			}
  		}
  
  		if (lineend < 0) {
  			StringBuffer input = new StringBuffer(256);
  			int c;
  			while (((c = read()) != -1) && (c != '\n')) {
  				input.append((char) c);
  			}
  			if ((c == -1) && (input.length() == 0)) {
  				return null;
  			}
  			return input.toString();
  		}
  
  		if (lineend > 0 && buffer[lineend - 1] == '\r') {
  			str = new String(buffer, 0, buf_pos, lineend - buf_pos - 1);
  		} else {
  			str = new String(buffer, 0, buf_pos, lineend - buf_pos);
  		}
  
  		buf_pos = lineend + 1;
  
  		return str;
  	}
docs: This method first decides if the buffer still contains unread contents.
  If it doesn't, the buffer needs to be filled up. If the new line
  delimiter can be found in the buffer, then a new line is read from the
  buffer and converted into String. Otherwise, it will simply call the read
  method to read byte by byte. Although the code of the latter portion is
  similar to the original readLine, performance is better here because the
  read method is buffered in the new class.
  
  @see uk.ac.ebi.embl.flatfile.reader.ILineReader#readline()