wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/DataUriGenerator.java
private void generateDataURI(final byte[] bytes, final Writer out, final String mimeType)
      throws IOException {
    // create the output
    final StringBuffer buffer = new StringBuffer();
    buffer.append(DATA_URI_PREFIX);
    
    // add MIME type
    buffer.append(mimeType);
    
    // output base64-encoding
    buffer.append(";base64,");
    buffer.append(Base64.encodeBytes(bytes));
    
    // output to writer
    out.write(buffer.toString());
  }
private void generateDataURI(final byte[] bytes, final Writer out, final String mimeType)
      throws IOException {
    // create the output
    final StringBuffer buffer = new StringBuffer();
    buffer.append(DATA_URI_PREFIX);
    
    // add MIME type
    buffer.append(mimeType);
    
    // output base64-encoding
    buffer.append(";base64,");
    buffer.append(Base64.encodeBytes(bytes));
    
    // output to writer
    out.write(buffer.toString());
  }
private void generateDataURI ( final byte [ ] bytes , final Writer out , final String mimeType ) throws IOException { // create the output final StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( DATA_URI_PREFIX ) ; // add MIME type buffer . append ( mimeType ) ; // output base64-encoding buffer . append ( ";base64," ) ; buffer . append ( Base64 . encodeBytes ( bytes ) ) ; // output to writer out . write ( buffer . toString ( ) ) ; }
Generates a data URI from a byte array and outputs to the given writer.

@param bytes
The array of bytes to output to the data URI.
@param out
Where to output the data URI.
@param mimeType
The MIME type to specify in the data URI.
@throws java.io.IOException
Generates a data URI from a byte array and outputs to the given writer .