Here you can find the source of toInputStreamFromBase64(String inBase64String)
public static InputStream toInputStreamFromBase64(String inBase64String)
//package com.java2s; //License from project: Open Source License import java.io.ByteArrayInputStream; import java.io.InputStream; import java.util.Base64; public class Main { public static final byte[] EMPTY_BYTES = new byte[0]; public static InputStream toInputStreamFromBase64(String inBase64String) { if (inBase64String == null) { return null; }// w w w . j a v a2 s . c o m return new ByteArrayInputStream(toBytesFromBase64(inBase64String)); } public static byte[] toBytesFromBase64(String inBase64String) { if (inBase64String == null) { return null; } if (inBase64String.trim().isEmpty()) { return EMPTY_BYTES; } return Base64.getDecoder().decode(inBase64String); } }