public class EncoderUtil extends Object
| Constructor and Description |
|---|
EncoderUtil() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
encode(BufferedImage image,
String format)
Encode the image in a specific format.
|
static byte[] |
encode(BufferedImage image,
String format,
boolean encodeAlpha)
Encode the image in a specific format.
|
static byte[] |
encode(BufferedImage image,
String format,
float quality)
Encode the image in a specific format.
|
static byte[] |
encode(BufferedImage image,
String format,
float quality,
boolean encodeAlpha)
Encode the image in a specific format.
|
static void |
writeBufferedImage(BufferedImage image,
String format,
OutputStream outputStream)
Encode the image in a specific format and write it to an OutputStream.
|
static void |
writeBufferedImage(BufferedImage image,
String format,
OutputStream outputStream,
boolean encodeAlpha)
Encode the image in a specific format and write it to an OutputStream.
|
static void |
writeBufferedImage(BufferedImage image,
String format,
OutputStream outputStream,
float quality)
Encode the image in a specific format and write it to an OutputStream.
|
static void |
writeBufferedImage(BufferedImage image,
String format,
OutputStream outputStream,
float quality,
boolean encodeAlpha)
Encode the image in a specific format and write it to an OutputStream.
|
public static byte[] encode(BufferedImage image, String format) throws IOException
image - The image to be encoded.format - The ImageFormat to use.IOExceptionpublic static byte[] encode(BufferedImage image, String format, boolean encodeAlpha) throws IOException
image - The image to be encoded.format - The ImageFormat to use.encodeAlpha - Whether to encode alpha transparency (not supported
by all ImageEncoders).IOExceptionpublic static byte[] encode(BufferedImage image, String format, float quality) throws IOException
image - The image to be encoded.format - The ImageFormat to use.quality - The quality to use for the image encoding (not supported
by all ImageEncoders).IOExceptionpublic static byte[] encode(BufferedImage image, String format, float quality, boolean encodeAlpha) throws IOException
image - The image to be encoded.format - The ImageFormat to use.quality - The quality to use for the image encoding (not supported
by all ImageEncoders).encodeAlpha - Whether to encode alpha transparency (not supported
by all ImageEncoders).IOExceptionpublic static void writeBufferedImage(BufferedImage image, String format, OutputStream outputStream) throws IOException
image - The image to be encoded.format - The ImageFormat to use.outputStream - The OutputStream to write the encoded image to.IOExceptionpublic static void writeBufferedImage(BufferedImage image, String format, OutputStream outputStream, float quality) throws IOException
image - The image to be encoded.format - The ImageFormat to use.outputStream - The OutputStream to write the encoded image to.quality - The quality to use for the image encoding (not
supported by all ImageEncoders).IOExceptionpublic static void writeBufferedImage(BufferedImage image, String format, OutputStream outputStream, boolean encodeAlpha) throws IOException
image - The image to be encoded.format - The ImageFormat to use.outputStream - The OutputStream to write the encoded image to.encodeAlpha - Whether to encode alpha transparency (not
supported by all ImageEncoders).IOExceptionpublic static void writeBufferedImage(BufferedImage image, String format, OutputStream outputStream, float quality, boolean encodeAlpha) throws IOException
image - The image to be encoded.format - The ImageFormat to use.outputStream - The OutputStream to write the encoded image to.quality - The quality to use for the image encoding (not
supported by all ImageEncoders).encodeAlpha - Whether to encode alpha transparency (not supported
by all ImageEncoders).IOExceptionCopyright © 2001-2014 JFree.org. All Rights Reserved.