wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/css/CssDataUriPreProcessor.java
protected boolean isReplaceAccepted(final String dataUri) {
    try {
      final byte[] bytes = dataUri.getBytes(CharEncoding.UTF_8);
      final boolean exceedLimit = bytes.length >= SIZE_LIMIT;
      LOG.debug("dataUri size: {}KB, limit exceeded: {}", bytes.length / 1024, exceedLimit);
      return !exceedLimit;
    } catch (final UnsupportedEncodingException e) {
      throw new WroRuntimeException("Should never happen", e);
    }
  }
protected boolean isReplaceAccepted(final String dataUri) {
    try {
      final byte[] bytes = dataUri.getBytes(CharEncoding.UTF_8);
      final boolean exceedLimit = bytes.length >= SIZE_LIMIT;
      LOG.debug("dataUri size: {}KB, limit exceeded: {}", bytes.length / 1024, exceedLimit);
      return !exceedLimit;
    } catch (final UnsupportedEncodingException e) {
      throw new WroRuntimeException("Should never happen", e);
    }
  }
protected boolean isReplaceAccepted ( final String dataUri ) { try { final byte [ ] bytes = dataUri . getBytes ( CharEncoding . UTF_8 ) ; final boolean exceedLimit = bytes . length >= SIZE_LIMIT ; LOG . debug ( "dataUri size: {}KB, limit exceeded: {}" , bytes . length / 1024 , exceedLimit ) ; return ! exceedLimit ; } catch ( final UnsupportedEncodingException e ) { throw new WroRuntimeException ( "Should never happen" , e ) ; } }
Similar to {@link CssDataUriPreProcessor#isReplaceAccepted(String)}, but decides whether the computed dataUri
should replace the image url. It is useful when you want to limit the dataUri size. By default the size of dataUri
is limited to 32KB (because IE8 has a 32KB limitation).

@param dataUri
base64 encoded stream.
@return true if dataUri should replace original image url.
Similar to { @link CssDataUriPreProcessor#isReplaceAccepted ( String ) } but decides whether the computed dataUri should replace the image url . It is useful when you want to limit the dataUri size . By default the size of dataUri is limited to 32KB ( because IE8 has a 32KB limitation ) .