code: public int read(int[] docs, int[] freqs) throws IOException {
          if (next && docs.length > 0) {
              docs[0] = doc;
              freqs[0] = 1;
              next = false;
              return 1;
          }
          return 0;
      }
docs: {@inheritDoc}