code: public String substringData(int offset, int count) throws DOMException {
          if ((offset < 0) || (count < 0)) {
              throw new DOMException(DOMException.INDEX_SIZE_ERR, null);
          }
          String data = getData();
          if (offset > data.length()) {
              throw new DOMException(DOMException.INDEX_SIZE_ERR, null);
          }
          if (offset + count > data.length()) {
              return data.substring(offset);
          } else {
              return data.substring(offset, offset + count);
          }
      }
docs: {@inheritDoc}