added Base64.InputStream
[org.ibex.util.git] / src / org / ibex / util / Base64.java
index d3bb10d..35fd3b9 100644 (file)
@@ -15,6 +15,11 @@ public class Base64 {
         (byte)'9', (byte)'+', (byte)'/'
     };
 
+    // FIXME could be far more efficient
+    public static class InputStream extends java.io.ByteArrayInputStream {
+        public InputStream(String s) { super(decode(s.getBytes())); }
+    }
+
     /**
      * encode the input data producong a base 64 encoded byte array.
      *