src/com/isode/stroke/stringcodecs/Base64.java
changeset 1015 63669480c941
child 1018 8daca77fabc1
equal deleted inserted replaced
1014:5d3c8519d297 1015:63669480c941
       
     1 /*
       
     2  * Copyright (c) 2010 Remko Tron¨on
       
     3  * Licensed under the GNU General Public License v3.
       
     4  * See Documentation/Licenses/GPLv3.txt for more information.
       
     5  */
       
     6 /*
       
     7  * Copyright (c) 2010, Isode Limited, London, England.
       
     8  * All rights reserved.
       
     9  */
       
    10 package com.isode.stroke.stringcodecs;
       
    11 
       
    12 import com.isode.stroke.base.ByteArray;
       
    13 
       
    14 public class Base64 {
       
    15     /* FIXME: Check license is ok (it is, it's BSD) */
       
    16     public static ByteArray decode(String input) {
       
    17         return new ByteArray(Base64BSD.decode(input));
       
    18     }
       
    19 
       
    20     public static String encode(ByteArray input) {
       
    21         return Base64BSD.encodeToString(input.getData(), false);
       
    22     }
       
    23 }