michael-o commented on code in PR #370:
URL: 
https://github.com/apache/httpcomponents-client/pull/370#discussion_r883702141


##########
httpclient5/src/main/java/org/apache/hc/client5/http/utils/Base64.java:
##########
@@ -0,0 +1,164 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.hc.client5.http.utils;
+
+
+import org.apache.hc.core5.annotation.Internal;
+
+import static java.util.Base64.getEncoder;
+import static java.util.Base64.getMimeDecoder;
+
+/**
+ * Provide implementations of the Base64 conversion methods from Commons 
Codec, delegating to the Java Base64
+ * implementation.
+ * <p>
+ * * <ul>Only the features currently used by HttpClient are implemented here 
rather than all the features of Commons Codec</ul>
+ * Notes:
+ * <p>
+ * <ul>Commons Codec accepts null inputs, so this is also accepted here. This 
is not done in the Java 8 implementation</ul>
+ * <ul>Decoding invalid input returns an empty value. The Java 8 
implementation throws an exception, which is caught here</ul>
+ * <ul>Commons Codec decoders accept both standard and url-safe variants of 
input. As this is not a requirement for
+ * HttpClient, this is NOT implemented here.
+ * </ul>
+ * <p>
+ * This class is intended as in interim convenience. Any new code should use 
`java.util.Base64` directly.
+ */
+@Internal
+public class Base64 {
+    private static final Base64 CODEC = new Base64();
+    private static final byte[] EMPTY_BYTES = new byte[0];
+
+    /**
+     * Return an instance of the Base64 codec that use the regular Base64 
alphabet
+     * (as opposed to the URL-safe alphabet). Note that unlike the Commons 
Codec version,
+     * thus class will NOT decode characters from URL-safe alphabet.
+     */
+    public Base64() {
+    }
+
+    /**
+     * Creates a Base64 codec used for decoding and encoding in URL-unsafe 
mode.
+     * <p>
+     * As HttpClient never uses a non-zero length, this feature is not 
implemented here.
+     */
+
+    public Base64(final int lineLength) {
+        if (lineLength != 0) {

Review Comment:
   If we don't use, why not remove? 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to