code: public boolean isValid(Class < T > javaClass, CobolContext cobolContext,
              byte[] hostData, int start) {
  
          int hostBytesLen = getBytesLen(charNum);
  
          // Is buffer large enough to contain this type?
          // TODO last field in a record might be truncated if all low-values or
          // spaces
          if (hostData.length < start + hostBytesLen) {
              return false;
          }
  
          if (javaClass.equals(String.class)) {
              return isValidString(cobolContext, hostData, start);
          } else if (javaClass.equals(ByteBuffer.class)) {
              return true;
          } else {
              throw new IllegalArgumentException("Unsupported java type "
                      + javaClass);
          }
      }
docs: {@inheritDoc}