Package org.apache.james.mime4j.storage

Examples of org.apache.james.mime4j.storage.StorageOutputStream


     * Stores the specified image in a Storage object.
     */
    private static Storage storeImage(StorageProvider storageProvider,
            BufferedImage image, String formatName) throws IOException {
        // An output stream that is capable of building a Storage object.
        StorageOutputStream out = storageProvider.createStorageOutputStream();

        // Write the image to our output stream. A StorageOutputStream can be
        // used to create attachments using any API that supports writing a
        // document to an output stream, e.g. iText's PdfWriter.
        ImageIO.write(image, formatName, out);

        // Implicitly closes the output stream and returns the data that has
        // been written to it.
        return out.toStorage();
    }
View Full Code Here


     * Stores the specified image in a Storage object.
     */
    private static Storage storeImage(StorageProvider storageProvider,
            BufferedImage image, String formatName) throws IOException {
        // An output stream that is capable of building a Storage object.
        StorageOutputStream out = storageProvider.createStorageOutputStream();

        // Write the image to our output stream. A StorageOutputStream can be
        // used to create attachments using any API that supports writing a
        // document to an output stream, e.g. iText's PdfWriter.
        ImageIO.write(image, formatName, out);

        // Implicitly closes the output stream and returns the data that has
        // been written to it.
        return out.toStorage();
    }
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.storage.StorageOutputStream

Copyright © 2018 www.massapicom. 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.