barcode4j 2.1.0

org.krysalis.barcode4j.output.bitmap
Class ImageIOBitmapEncoder

java.lang.Object
  extended by org.krysalis.barcode4j.output.bitmap.ImageIOBitmapEncoder
All Implemented Interfaces:
BitmapEncoder

public class ImageIOBitmapEncoder
extends java.lang.Object
implements BitmapEncoder

BitmapEncoder implementation using ImageIO.

Author:
Jeremias Maerki

Constructor Summary
ImageIOBitmapEncoder()
          Constructs the BitmapEncoder.
 
Method Summary
 void encode(java.awt.image.BufferedImage image, java.io.OutputStream out, java.lang.String mime, int resolution)
          Encodes a BufferedImage to a target format and writes it to the OutputStream.
 java.lang.String[] getSupportedMIMETypes()
          Returns an array of MIME types supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageIOBitmapEncoder

public ImageIOBitmapEncoder()
                     throws java.lang.ClassNotFoundException
Constructs the BitmapEncoder. The constructor checks if the ImageIO API is available so it doesn't get registered in case it's not there.

Throws:
java.lang.ClassNotFoundException - if the ImageIO API is unavailable
Method Detail

getSupportedMIMETypes

public java.lang.String[] getSupportedMIMETypes()
Returns an array of MIME types supported.

Specified by:
getSupportedMIMETypes in interface BitmapEncoder
Returns:
the array of MIME types

encode

public void encode(java.awt.image.BufferedImage image,
                   java.io.OutputStream out,
                   java.lang.String mime,
                   int resolution)
            throws java.io.IOException
Encodes a BufferedImage to a target format and writes it to the OutputStream.

Specified by:
encode in interface BitmapEncoder
Parameters:
image - the image to encode
out - the OutputStream to write the image to
mime - the MIME type in which to encode the image
resolution - the resolution in dpi of the image
Throws:
java.io.IOException - in case of an I/O problem

barcode4j 2.1.0

Copyright © 2000-2010 Jeremias Maerki. All rights reserved.