#/**
* This method is used to convert encoded base 64 image string into inputStream without saving it into file system
* @param : encodedBase64Image - Contains encoded base 64 image string
* @return :InputStream
*
*/#
将64位图像字符串编码到inputStream中,而不将其保存到文件系统中
InputStream getInputStream(final String encodedBase64Image) {
long mediaId
// create a buffered image
BufferedImage image = null
byte[] imageByte;
imageByte = EncodingGroovyMethods.decodeBase64(encodedBase64Image) // Coverting encoded image string into byte array
ByteArrayInputStream bis = new ByteArrayInputStream(imageByte)
image = ImageIO.read(bis)
RenderedImage rImage = (RenderedImage) image; // forming rendered image
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(rImage, "jpg", os); // JPEG Image is formed in OutputStream
InputStream fis = new ByteArrayInputStream(os.toByteArray()); /* OutputStream into Inputstream */
return InputStream
}
将64位图像字符串编码到inputStream中,而不将其保存到文件系统中