code: static void dataUri( CssFormatter formatter, String relativeUrlStr, final String urlString, String type ) throws IOException {
          String urlStr = removeQuote( urlString );
          InputStream input;
          try {
              input = formatter.getReaderFactory().openStream( formatter.getBaseURL(), urlStr, relativeUrlStr );
          } catch( Exception e ) {
              boolean quote = urlString != urlStr;
              String rewrittenUrl;
              if( formatter.isRewriteUrl( urlStr ) ) {
                  URL relativeUrl = new URL( relativeUrlStr );
                  relativeUrl = new URL( relativeUrl, urlStr );
                  rewrittenUrl = relativeUrl.getPath();
                  rewrittenUrl = quote ? urlString.charAt( 0 ) + rewrittenUrl + urlString.charAt( 0 ) : rewrittenUrl;
              } else {
                  rewrittenUrl = urlString;
              }
              formatter.append( "url(" ).append( rewrittenUrl ).append( ')' );
              return;
          }
          ByteArrayOutputStream buffer = new ByteArrayOutputStream();
  
          int count;
          byte[] data = new byte[16384];
  
          while( (count = input.read( data, 0, data.length )) > 0 ) {
              buffer.write( data, 0, count );
          }
          input.close();
  
          byte[] bytes = buffer.toByteArray();
  
          if( bytes.length >= 32 * 1024 ) {
              formatter.append( "url(" ).append( urlString ).append( ')' );
          } else {
              dataUri( formatter, bytes, urlStr, type );
          }
      }
docs: Implementation of the function data-uri.
  
  @param formatter current formatter
  @param relativeUrlStr relative URL of the less script. Is used as base URL
  @param urlString the url parameter of the function
  @param type the mime type
  @throws IOException If any I/O errors occur on reading the content