Package railo.runtime.converter.bin

Source Code of railo.runtime.converter.bin.ImageConverter

package railo.runtime.converter.bin;

import java.io.IOException;
import java.io.OutputStream;

import railo.runtime.PageContext;
import railo.runtime.converter.BinaryConverter;
import railo.runtime.converter.ConverterException;
import railo.runtime.converter.ConverterSupport;
import railo.runtime.img.Image;

public class ImageConverter implements BinaryConverter {
 
  private final String format;

  public ImageConverter(String format){
    this.format=format;
  }
 
  @Override
  public void writeOut(PageContext pc,Object source, OutputStream os) throws ConverterException, IOException {
    try {
      Image img = Image.createImage(pc, source, false, true,true,format);
      img.writeOut(os, format, 1, false);
    }
    catch (IOException ioe) {
      throw ioe;
    }
    catch (Exception e) {
      throw ConverterSupport.toConverterException(e);
    }
   
  }
 
 
}
TOP

Related Classes of railo.runtime.converter.bin.ImageConverter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.