@Override
    public void write(IIOMetadata streamMetadata, IIOImage iioimage, ImageWriteParam param) throws IOException {
        if (output == null) {
            throw new IllegalStateException(Messages.getString("imageio.81"));
        }
        if (iioimage == null) {
            throw new IllegalArgumentException(Messages.getString("imageio.82"));
        }
        if (iioimage.hasRaster() && !canWriteRasters()) {
            throw new UnsupportedOperationException(Messages.getString("imageio.83"));
        }// ImageOutputStreamImpl

        RenderedImage image = iioimage.getRenderedImage();

        try {
        	Map params = new HashMap();
        	Sanselan.writeImage((BufferedImage) image,
        			wrapOutput(getOutput()),
        			ImageFormat.IMAGE_FORMAT_PNG,
        			params);
        }
        catch (ImageWriteException e) {
			e.printStackTrace();
		}
        
    }