Java Byte Array Create toBytesFromBase64(String inBase64String)

Here you can find the source of toBytesFromBase64(String inBase64String)

Description

to Bytes From Base

License

Open Source License

Declaration

public static byte[] toBytesFromBase64(String inBase64String) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Base64;

public class Main {
    public static final byte[] EMPTY_BYTES = new byte[0];

    public static byte[] toBytesFromBase64(String inBase64String) {

        if (inBase64String == null) {
            return null;
        }/*from  w  w  w  .  j  a v  a  2s  .c o m*/
        if (inBase64String.trim().isEmpty()) {
            return EMPTY_BYTES;
        }

        return Base64.getDecoder().decode(inBase64String);
    }
}

Related

  1. toBytesBE(long v)
  2. toBytesBigEndian(long value, int sizeInByte)
  3. toBytesBinary(String in)
  4. toBytesDirect(final String singleOctets)
  5. toBytesFromASCII(final char[] chars)
  6. toBytesFromBin(String binSymbols)
  7. toBytesFromHexStr(String hexStr)
  8. toBytesFromHexString(String digits)
  9. toBytesFromOct(String octSymbols)