You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2021/03/24 08:23:52 UTC

[GitHub] [solr] janhoy commented on a change in pull request #24: SOLR-15111 Use JDK8 Base64 instead of own implementation

janhoy commented on a change in pull request #24:
URL: https://github.com/apache/solr/pull/24#discussion_r600261414



##########
File path: solr/core/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
##########
@@ -298,7 +300,7 @@ private static String getFieldFlags( SchemaField f )
 
       BytesRef bytes = field.binaryValue();
       if (bytes != null) {
-        f.add( "binary", Base64.byteArrayToBase64(bytes.bytes, bytes.offset, bytes.length));
+        f.add( "binary", new String(Base64.getEncoder().encode(ByteBuffer.wrap(bytes.bytes, bytes.offset, bytes.length)).array(), StandardCharsets.ISO_8859_1));

Review comment:
       Can be simplified to `Base64.getEncoder().encodeToString(ByteBuffer.wrap(bytes.bytes, bytes.offset, bytes.length).array())`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org