Popular Posts
javax.net.ssl.SSLHandshakeException: Connection closed by peer in Android 5.0 Lollipop Recently, there is a error occurs when access website via ssl connection like below although it worked fine several days ago. // Enable SSL... Tired of Hibernate? Try JDBI in your code JDBI Quick sample ICategoryDAO.java : create a data access interface (implement is not required) package com.prhythm.erotic.task.data.... Enable SSL connection for Jsoup import org.jsoup.Connection; import org.jsoup.Jsoup; import javax.net.ssl.*; import java.io.IOException; import java.security.KeyManagement...
Stats
Create multi tiff image
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.IIOImage;
import javax.imageio.ImageIO;
import javax.imageio.ImageWriter;

import com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriterSpi;

public class Tiff {

    public static void createMultiImage(BufferedImage[] images, File dest) throws IOException {
        ImageIO.scanForPlugins();

        ImageWriter iw = new TIFFImageWriterSpi().createWriterInstance();

        if (iw != null && iw.canWriteSequence()) {
            iw.setOutput(ImageIO.createImageOutputStream(dest));

            iw.prepareWriteSequence(null);

            for (BufferedImage img : images) {
                iw.writeToSequence(new IIOImage(img, null, null), null);
            }

            iw.endWriteSequence();
        }
    }

}
required package : https://jai-imageio.dev.java.net/