Java Utililty Methods Byte Array Decode

List of utility methods to do Byte Array Decode

Description

The list of methods to do Byte Array Decode are organized into topic(s).

Method

byte[]decode(byte[] b)
decode
ByteArrayInputStream bais = new ByteArrayInputStream(b);
InputStream b64is = MimeUtility.decode(bais, "base64");
byte[] tmp = new byte[b.length];
int n = b64is.read(tmp);
byte[] res = new byte[n];
System.arraycopy(tmp, 0, res, 0, n);
return res;
Stringdecode(byte[] bytes)
decode
try {
    return new String(bytes, "UTF-8"); 
} catch (UnsupportedEncodingException e) {
    return new String(bytes);
Tdecode(byte[] bytes)
decode
if (bytes == null) {
    return null;
T t = null;
Exception thrown = null;
try {
    ObjectInputStream oin = new ObjectInputStream(new ByteArrayInputStream(bytes));
    t = (T) oin.readObject();
...
byte[]decode(byte[] bytes)
Decodes the specified bytes.
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
ByteArrayOutputStream out = new ByteArrayOutputStream();
decode(in, out);
return out.toByteArray();
InputStreamdecode(byte[] msgToDecode)
DEFLATE decoding
ByteArrayInputStream bais = new ByteArrayInputStream(msgToDecode);
return new InflaterInputStream(bais, new Inflater(true));
byte[]decode(byte[] source)
Low-level access to decoding ASCII characters in the form of a byte array.
byte[] decoded = null;
decoded = decode(source, 0, source.length, NO_OPTIONS);
return decoded;
byte[]decode(byte[] source, int off, int len)
Very low-level access to decoding ASCII characters in the form of a byte array.
int len34 = len * 3 / 4;
byte[] outBuff = new byte[len34]; 
int outBuffPosn = 0;
byte[] b4 = new byte[4];
int b4Posn = 0;
int i = 0;
byte sbiCrop = 0;
byte sbiDecode = 0;
...
Stringdecode(byte[] src, String charset)
decode
return decode(src, 0, src.length, charset);
CompositeDatadecode(Byte[] wrap)
decode
if (null == wrap)
    return null;
byte[] prim = new byte[wrap.length];
for (int i = 0; i < wrap.length; i++) {
    prim[i] = wrap[i];
ByteArrayInputStream inBytes = new ByteArrayInputStream(prim);
ObjectInputStream inObject;
...
byte[]decode(final byte[] source, final int off, final int len)
Very low-level access to decoding ASCII characters in the form of a byte array.
int len34 = len * 3 / 4;
byte[] outBuff = new byte[len34]; 
int outBuffPosn = 0;
byte[] b4 = new byte[4];
int b4Posn = 0;
int i = 0;
byte sbiCrop = 0;
byte sbiDecode = 0;
...