code: public DirRecord nextRecord() throws NamingException {
      if (inp == null) {
        if (in == null) {
          throw new NamingException("No ldif input stream");
        }
  
        inp = new LdifRecord.Input();
        inp.init(new InputStreamReader(in));
      } else if (inp.eof) {
        return null;
      }
  
      LdifRecord ldr = new LdifRecord();
  
      if (!ldr.read(inp)) {
        return null;
      }
  
      return ldr;
    }
docs: Return the next record in the input stream.