code: public ValueSet readTemplatesByRange(int index, int length) {
          Result result = htod.readTemplatesByRange(index, length);
          if (result.returnCode == HTODDynacache.DISK_EXCEPTION) {
              stopOnError(result.diskException);
              this.htod.returnToResultPool(result);
              return HTODDynacache.EMPTY_VS;
          }
          ValueSet valueSet = (ValueSet) result.data;
          if (valueSet == null) {
              valueSet = HTODDynacache.EMPTY_VS;
          }
          this.htod.returnToResultPool(result);
          return valueSet;
      }
docs: Call this method to get the template ids based on the index and the length from the disk.
  
  @param index
  If index = 0, it starts the beginning. If index = 1, it means "next". If Index = -1, it means
  "previous".
  @param length
  The max number of templates to be read. If length = -1, it reads all templates until the end.
  @return valueSet - the collection of templates.