code: @Override
      public boolean nextKeyValue() throws IOException, InterruptedException {
          if (key == null) {
              key = new Key();
          }
          key.clear();
          key.addPrimitiveValue("KEY", pos);
          key.addPrimitiveValue("FILE_NAME", fileName);
          key.addPrimitiveValue("FILE_LENGTH", fileLength);
          if (value == null) {
              value = new Value();
          }
          value.clear();
          int newSize = 0;
          while (pos < end) {
              newSize = in.readLine(text, maxLineLength,
                                    Math.max((int)Math.min(Integer.MAX_VALUE, end-pos),
                                             maxLineLength));
              if (newSize == 0) {
                  break;
              }
  
              valueCreator.create(text.toString(), value);
  
              pos += newSize;
              if (newSize < maxLineLength) {
                  break;
              }
  
              // line too long. try again
              LOG.info("Skipped line of size " + newSize + " at pos " +
                       (pos - newSize));
          }
          if (newSize == 0) {
              key = null;
              value = null;
              return false;
          } else {
              return true;
          }
      }
docs: {@inheritDoc}