- /**
- * Convert the given {@link Image} object into a Base64 representation of
- * the same {@link Image} object.
- * <p>
- * Note: if possible, prefer the {@link Image#newInputStream()} method, as
- * it can be more efficient.
- *
- * @return the Base64 representation
- */
- public String toBase64() {
- try {
- return StringUtils.base64(getData(), false);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-