static void dataUri( CssFormatter formatter, byte[] bytes, String urlStr, String type ) {
        if( type == null ) {
            switch( urlStr.substring( urlStr.lastIndexOf( '.' ) + 1 ) ) {
                case "gif": 
                    type = "image/gif;base64";
                    break;
                case "png": 
                    type = "image/png;base64";
                    break;
                case "jpg":
                case "jpeg":
                    type = "image/jpeg;base64";
                    break;
                default: 
                    type = "text/html";
            }
        } else {
            type = removeQuote( type );
        }

        if( type.endsWith( "base64" ) ) {
            formatter.append( "url(\"data:" ).append( type ).append( ',' );
            formatter.append( toBase64( bytes ) );
            formatter.append( "\")" );
        } else {
            formatter.append( "url(\"data:" ).append( type ).append( ',' );
            appendEncode( formatter, bytes );
            formatter.append( "\")" );
        }
    }
static void dataUri ( CssFormatter formatter , byte [ ] bytes , String urlStr , String type ) { if ( type == null ) { switch ( urlStr . substring ( urlStr . lastIndexOf ( '.' ) + 1 ) ) { case "gif" : type = "image/gif;base64" ; break ; case "png" : type = "image/png;base64" ; break ; case "jpg" : case "jpeg" : type = "image/jpeg;base64" ; break ; default : type = "text/html" ; } } else { type = removeQuote ( type ) ; } if ( type . endsWith ( "base64" ) ) { formatter . append ( "url(\"data:" ) . append ( type ) . append ( ',' ) ; formatter . append ( toBase64 ( bytes ) ) ; formatter . append ( "\")" ) ; } else { formatter . append ( "url(\"data:" ) . append ( type ) . append ( ',' ) ; appendEncode ( formatter , bytes ) ; formatter . append ( "\")" ) ; } }
Write the bytes as inline url.

@param formatter current formatter
@param bytes the bytes
@param urlStr used if mime type is null to detect the mime type
@param type the mime type