Examples of Base64EncoderStream


Examples of org.apache.flex.forks.batik.util.Base64EncoderStream

        //
        // Setup Base64Encoder stream to byte array.
        //
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        Base64EncoderStream b64Encoder = new Base64EncoderStream(os);
        try {
            //
            // Now, encode the input image to the base 64 stream.
            //
            encodeImage(image, b64Encoder);

            // Close the b64 encoder stream (terminates the b64 streams).
            b64Encoder.close();
        } catch (IOException e) {
            // Should not happen because we are doing in-memory processing
            throw new SVGGraphics2DIOException(ERR_UNEXPECTED, e);
        }
View Full Code Here

Examples of org.apache.flex.forks.batik.util.Base64EncoderStream

    /**
     * Uses PNG encoding.
     */
    public void encodeImage(BufferedImage buf, OutputStream os)
            throws IOException {
        Base64EncoderStream b64Encoder = new Base64EncoderStream(os);
        ImageEncoder encoder = new PNGImageEncoder(b64Encoder, null);
        encoder.encode(buf);
        b64Encoder.close();
    }
View Full Code Here

Examples of org.apache.flex.forks.batik.util.Base64EncoderStream

    /**
     * Uses PNG encoding.
     */
    public void encodeImage(BufferedImage buf, OutputStream os)
            throws IOException {
        Base64EncoderStream b64Encoder = new Base64EncoderStream(os);
        ImageWriter writer = ImageWriterRegistry.getInstance()
            .getWriterFor("image/png");
        writer.writeImage(buf, b64Encoder);
        b64Encoder.close();
    }
View Full Code Here

Examples of org.apache.flex.forks.batik.util.Base64EncoderStream

        //
        // Setup Base64Encoder stream to byte array.
        //
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        Base64EncoderStream b64Encoder = new Base64EncoderStream(os);
        try {
            //
            // Now, encode the input image to the base 64 stream.
            //
            encodeImage(image, b64Encoder);

            // Close the b64 encoder stream (terminates the b64 streams).
            b64Encoder.close();
        } catch (IOException e) {
            // Should not happen because we are doing in-memory processing
            throw new SVGGraphics2DIOException(ERR_UNEXPECTED, e);
        }
View Full Code Here

Examples of org.apache.flex.forks.batik.util.Base64EncoderStream

public class Base64PNGEncoderTest extends PNGEncoderTest {
    /**
     * Template method for building the PNG output stream
     */
    public OutputStream buildOutputStream(ByteArrayOutputStream bos){
        return new Base64EncoderStream(bos);
    }
View Full Code Here

Examples of org.apache.geronimo.mail.util.Base64EncoderStream

        // some encodies are just pass-throughs, with no real decoding.
        if (encoding.equals("binary") || encoding.equals("7bit") || encoding.equals("8bit")) {
            return out;
        }
        else if (encoding.equals("base64")) {
            return new Base64EncoderStream(out);
        }
        // UUEncode is known by a couple historical extension names too.
        else if (encoding.equals("uuencode") || encoding.equals("x-uuencode") || encoding.equals("x-uue")) {
            return new UUEncoderStream(out);
        }
View Full Code Here

Examples of org.apache.geronimo.mail.util.Base64EncoderStream

        // some encodies are just pass-throughs, with no real decoding.
        if (encoding.equals("binary") || encoding.equals("7bit") || encoding.equals("8bit")) {
            return out;
        }
        else if (encoding.equals("base64")) {
            return new Base64EncoderStream(out);
        }
        // UUEncode is known by a couple historical extension names too.
        else if (encoding.equals("uuencode") || encoding.equals("x-uuencode") || encoding.equals("x-uue")) {
            return new UUEncoderStream(out, filename);
        }
View Full Code Here
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.