From 2a7fbf81f6349d69207ed50c0a76e6e0d71e7072 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Fri, 27 Nov 2020 19:42:05 +0100 Subject: [PATCH] Removed deprecated DataTypeConverter --- src/main/java/w2phtml/xhtml/content/DrawParser.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/w2phtml/xhtml/content/DrawParser.java b/src/main/java/w2phtml/xhtml/content/DrawParser.java index beaf586..2a1700e 100644 --- a/src/main/java/w2phtml/xhtml/content/DrawParser.java +++ b/src/main/java/w2phtml/xhtml/content/DrawParser.java @@ -46,8 +46,8 @@ import java.util.Vector; import java.io.ByteArrayInputStream; import java.io.IOException; -import javax.xml.bind.DatatypeConverter; - +//import javax.xml.bind.DatatypeConverter; +import java.util.Base64; import org.xml.sax.SAXException; import w2phtml.base.BinaryGraphicsDocument; @@ -601,7 +601,8 @@ public class DrawParser extends Parser { buf.append(bgd.getMIMEType()); buf.append(";base64,"); if (bgd.getData() != null) { - buf.append(DatatypeConverter.printBase64Binary(bgd.getData())); + //buf.append(DatatypeConverter.printBase64Binary(bgd.getData())); + buf.append(Base64.getEncoder().encodeToString(bgd.getData())); } image.setAttribute("src", buf.toString()); }