Back to project page TextEncoder.
The source code is released under:
Apache License
If you think the Android project TextEncoder listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.csab.TextEncoder; /*from ww w . j a v a 2 s.co m*/ import android.content.Context; import android.util.Base64; import org.apache.commons.codec.binary.StringUtils; public class Base64Message extends Message { public Base64Message(byte[] inputArray) { setByteValuesArray(inputArray); } public Base64Message(String inputString, Context context) { setByteValuesArray(Base64.decode(inputString, Base64.DEFAULT)); } public <T> T convert(Class<T> clazz) throws Exception { return clazz.getConstructor(byte[].class).newInstance(getByteValuesArray()); } @Override public String toString() { return StringUtils.newStringUsAscii(Base64.encode(getByteValuesArray(), Base64.DEFAULT)); } }