james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r891424 - in /james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j: QuotedPrintableInputStreamBench.java QuotedPrintableOutputStreamBench.java
Date Wed, 16 Dec 2009 21:00:20 GMT
Author: olegk
Date: Wed Dec 16 21:00:20 2009
New Revision: 891424

URL: http://svn.apache.org/viewvc?rev=891424&view=rev
Log:
QP coding benchmarks

Added:
    james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/QuotedPrintableInputStreamBench.java
      - copied, changed from r881442, james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/Base64InputStreamBench.java
    james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/QuotedPrintableOutputStreamBench.java
      - copied, changed from r881442, james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/Base64OutputStreamBench.java

Copied: james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/QuotedPrintableInputStreamBench.java
(from r881442, james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/Base64InputStreamBench.java)
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/QuotedPrintableInputStreamBench.java?p2=james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/QuotedPrintableInputStreamBench.java&p1=james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/Base64InputStreamBench.java&r1=881442&r2=891424&rev=891424&view=diff
==============================================================================
--- james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/Base64InputStreamBench.java
(original)
+++ james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/QuotedPrintableInputStreamBench.java
Wed Dec 16 21:00:20 2009
@@ -27,10 +27,10 @@
 import java.util.Random;
 
 import org.apache.commons.io.output.NullOutputStream;
-import org.apache.james.mime4j.codec.Base64InputStream;
 import org.apache.james.mime4j.codec.CodecUtil;
+import org.apache.james.mime4j.codec.QuotedPrintableInputStream;
 
-public class Base64InputStreamBench {
+public class QuotedPrintableInputStreamBench {
 
     public static void main(String[] args) throws Exception {
         byte[] data = initData(2 * 1024 * 1024);
@@ -46,7 +46,7 @@
 
         for (int i = 0; i < 5; i++) {
             ByteArrayInputStream ed = new ByteArrayInputStream(encoded);
-            InputStream in = new Base64InputStream(ed);
+            InputStream in = new QuotedPrintableInputStream(ed);
             CodecUtil.copy(in, nullOut);
         }
         Thread.sleep(100);
@@ -58,7 +58,7 @@
         final int repetitions = 50;
         for (int i = 0; i < repetitions; i++) {
             ByteArrayInputStream ed = new ByteArrayInputStream(encoded);
-            InputStream in = new Base64InputStream(ed);
+            InputStream in = new QuotedPrintableInputStream(ed);
             CodecUtil.copy(in, nullOut);
         }
 
@@ -82,14 +82,14 @@
     private static byte[] encode(byte[] data) throws IOException {
         InputStream in = new ByteArrayInputStream(data);
         ByteArrayOutputStream out = new ByteArrayOutputStream();
-        CodecUtil.encodeBase64(in, out);
+        CodecUtil.encodeQuotedPrintableBinary(in, out);
         return out.toByteArray();
     }
 
     private static void testDecode(byte[] data, final byte[] encoded)
             throws IOException {
         ByteArrayInputStream ed = new ByteArrayInputStream(encoded);
-        InputStream in = new Base64InputStream(ed);
+        InputStream in = new QuotedPrintableInputStream(ed);
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         CodecUtil.copy(in, out);
 

Copied: james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/QuotedPrintableOutputStreamBench.java
(from r881442, james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/Base64OutputStreamBench.java)
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/QuotedPrintableOutputStreamBench.java?p2=james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/QuotedPrintableOutputStreamBench.java&p1=james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/Base64OutputStreamBench.java&r1=881442&r2=891424&rev=891424&view=diff
==============================================================================
--- james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/Base64OutputStreamBench.java
(original)
+++ james/mime4j/trunk/benchmark/src/main/java/org/apache/james/mime4j/QuotedPrintableOutputStreamBench.java
Wed Dec 16 21:00:20 2009
@@ -23,15 +23,15 @@
 import java.util.Random;
 
 import org.apache.commons.io.output.NullOutputStream;
-import org.apache.james.mime4j.codec.Base64OutputStream;
+import org.apache.james.mime4j.codec.QuotedPrintableOutputStream;
 
-public class Base64OutputStreamBench {
+public class QuotedPrintableOutputStreamBench {
 
     public static void main(String[] args) throws Exception {
         byte[] data = initData(1024);
 
         OutputStream nullOut = new NullOutputStream();
-        Base64OutputStream base64Out = new Base64OutputStream(nullOut);
+        QuotedPrintableOutputStream base64Out = new QuotedPrintableOutputStream(nullOut,
true);
 
         // warmup
 



Mime
View raw message