Java Base64 Convert to fromBase64decodedImageToByte(String base64encoded)

Here you can find the source of fromBase64decodedImageToByte(String base64encoded)

Description

from Basedecoded Image To Byte

License

Apache License

Declaration

public static byte[] fromBase64decodedImageToByte(String base64encoded) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Base64;

public class Main {
    public static byte[] fromBase64decodedImageToByte(String base64encoded) {

        if (base64encoded == null || base64encoded.trim().length() == 0) {
            return null;
        }/*from w  w w.  j a  v a 2s  . c  o  m*/
        String[] split = base64encoded.split(",");

        if (split.length < 2)
            return null;

        String base64Image = split[1];
        return Base64.getDecoder().decode(base64Image);
    }
}

Related

  1. fromBase64(String base64)
  2. fromBase64(String base64Text)
  3. fromBase64(String data)
  4. fromBase64(String s)
  5. fromBase64(String str)
  6. fromBase64Impl(String data)
  7. fromBase64String(String base64)
  8. fromBase64String(String encoded)
  9. fromBase64Url(String data)