Examples of QuotedPrintableOutputStream


Examples of org.apache.james.mime4j.codec.QuotedPrintableOutputStream

    public static void main(String[] args) throws Exception {
        byte[] data = initData(1024);

        OutputStream nullOut = new NullOutputStream();
        QuotedPrintableOutputStream base64Out = new QuotedPrintableOutputStream(nullOut, true);

        // warmup

        for (int i = 0; i < 2000; i++) {
            base64Out.write(data);
        }
        Thread.sleep(100);

        // test

        long t0 = System.currentTimeMillis();

        final int repetitions = 500000;
        for (int i = 0; i < repetitions; i++) {
            base64Out.write(data);
        }
        base64Out.close();

        long dt = System.currentTimeMillis() - t0;
        long totalBytes = data.length * (long) repetitions;

        double mbPerSec = (totalBytes / 1024.0 / 1024) / (dt / 1000.0);
View Full Code Here

Examples of org.apache.james.mime4j.codec.QuotedPrintableOutputStream

    protected OutputStream encodeStream(OutputStream out, String encoding,
            boolean binaryBody) throws IOException {
        if (MimeUtil.isBase64Encoding(encoding)) {
            return new Base64OutputStream(out);
        } else if (MimeUtil.isQuotedPrintableEncoded(encoding)) {
            return new QuotedPrintableOutputStream(out, binaryBody);
        } else {
            return out;
        }
    }
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.