wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/DataUriGenerator.java
public String generateDataURI(final InputStream inputStream, final String fileName)
      throws IOException {
    final StringWriter writer = new StringWriter();
    final byte[] bytes = IOUtils.toByteArray(inputStream);
    inputStream.close();

    final String mimeType = getMimeType(fileName);
    // actually write
    generateDataURI(bytes, writer, mimeType);

    return writer.toString();
  }
public String generateDataURI(final InputStream inputStream, final String fileName)
      throws IOException {
    final StringWriter writer = new StringWriter();
    final byte[] bytes = IOUtils.toByteArray(inputStream);
    inputStream.close();

    final String mimeType = getMimeType(fileName);
    // actually write
    generateDataURI(bytes, writer, mimeType);

    return writer.toString();
  }
public String generateDataURI ( final InputStream inputStream , final String fileName ) throws IOException { final StringWriter writer = new StringWriter ( ) ; final byte [ ] bytes = IOUtils . toByteArray ( inputStream ) ; inputStream . close ( ) ; final String mimeType = getMimeType ( fileName ) ; // actually write generateDataURI ( bytes , writer , mimeType ) ; return writer . toString ( ) ; }
Generate the dataUri as string associated to the passed InputStream with encoding & type based on provided
fileName.
Generate the dataUri as string associated to the passed InputStream with encoding & type based on provided fileName .