Removed deprecated DataTypeConverter

This commit is contained in:
Georgy Litvinov 2020-11-27 19:42:05 +01:00
parent b170acdece
commit 2a7fbf81f6

View file

@ -46,8 +46,8 @@ import java.util.Vector;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import javax.xml.bind.DatatypeConverter; //import javax.xml.bind.DatatypeConverter;
import java.util.Base64;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import w2phtml.base.BinaryGraphicsDocument; import w2phtml.base.BinaryGraphicsDocument;
@ -601,7 +601,8 @@ public class DrawParser extends Parser {
buf.append(bgd.getMIMEType()); buf.append(bgd.getMIMEType());
buf.append(";base64,"); buf.append(";base64,");
if (bgd.getData() != null) { 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()); image.setAttribute("src", buf.toString());
} }