List of usage examples for com.liferay.portal.kernel.image ImageToolUtil write
public static void write(RenderedImage renderedImage, String contentType, OutputStream os) throws IOException
From source file:com.liferay.adaptive.media.image.internal.util.RenderedImageUtil.java
License:Open Source License
public static byte[] getRenderedImageContentStream(RenderedImage renderedImage, String mimeType) throws IOException { try (UnsyncByteArrayOutputStream baos = new UnsyncByteArrayOutputStream()) { ImageToolUtil.write(renderedImage, mimeType, baos); return baos.toByteArray(); } catch (IOException ioe) { throw new AdaptiveMediaRuntimeException.IOException(ioe); }//from w ww . jav a2 s .com }