You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/org/apache/commons/codec/binary/Base64.java
+17-13Lines changed: 17 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -32,15 +32,19 @@
32
32
* This class implements <a href="https://www.ietf.org/rfc/rfc2045#section-6.8">RFC 2045 6.8. Base64 Content-Transfer-Encoding</a>.
33
33
* </p>
34
34
* <p>
35
-
* The class can be parameterized in the following manner with various constructors:
35
+
* The class can be parameterized in the following manner with its {@link Builder}:
36
36
* </p>
37
37
* <ul>
38
38
* <li>URL-safe mode: Default off.</li>
39
39
* <li>Line length: Default 76. Line length that aren't multiples of 4 will still essentially end up being multiples of 4 in the encoded data.
40
40
* <li>Line separator: Default is CRLF ({@code "\r\n"})</li>
41
+
* <li>Strict or lenient decoding policy; default is {@link CodecPolicy#LENIENT}.</li>
42
+
* <li>Custom decoding table.</li>
43
+
* <li>Custom encoding table.</li>
44
+
* <li>Padding; defaults is {@code '='}.</li>
41
45
* </ul>
42
46
* <p>
43
-
* The URL-safe parameter is only applied to encode operations. Decoding seamlessly handles both modes.
47
+
* The URL-safe parameter is only applied to encode operations. Decoding seamlessly handles both modes, see also {@link Builder#setDecodeTableFormat(DecodeTableFormat)}.
44
48
* </p>
45
49
* <p>
46
50
* Since this class operates directly on byte streams, and not character streams, it is hard-coded to only encode/decode character encodings which are
@@ -55,7 +59,7 @@
55
59
*
56
60
* <pre>
57
61
* Base64 base64 = Base64.builder()
58
-
* .setDecodingPolicy(DecodingPolicy.LENIENT) // default is lenient, null resets to default
62
+
* .setDecodingPolicy(CodecPolicy.LENIENT) // default is lenient, null resets to default
59
63
* .setEncodeTable(customEncodeTable) // default is built in, null resets to default
60
64
* .setLineLength(0) // default is none
61
65
* .setLineSeparator('\r', '\n') // default is CR LF, null resets to default
@@ -81,7 +85,7 @@ public class Base64 extends BaseNCodec {
81
85
*
82
86
* <pre>
83
87
* Base64 base64 = Base64.builder()
84
-
* .setDecodingPolicy(DecodingPolicy.LENIENT) // default is lenient, null resets to default
88
+
* .setCodecPolicy(CodecPolicy.LENIENT) // default is lenient, null resets to default
85
89
* .setEncodeTable(customEncodeTable) // default is built in, null resets to default
86
90
* .setLineLength(0) // default is none
87
91
* .setLineSeparator('\r', '\n') // default is CR LF, null resets to default
@@ -323,7 +327,7 @@ public enum DecodeTableFormat {
323
327
*
324
328
* <pre>
325
329
* Base64 base64 = Base64.builder()
326
-
* .setDecodingPolicy(DecodingPolicy.LENIENT) // default is lenient, null resets to default
330
+
* .setDecodingPolicy(CodecPolicy.LENIENT) // default is lenient, null resets to default
327
331
* .setEncodeTable(customEncodeTable) // default is built in, null resets to default
328
332
* .setLineLength(0) // default is none
329
333
* .setLineSeparator('\r', '\n') // default is CR LF, null resets to default
* This method seamlessly handles data encoded in URL-safe or normal mode. For enforcing verification against strict standard Base64 or Base64 URL-safe
361
-
* tables, please use {@link #decodeBase64Standard(byte[])} or {@link #decodeBase64UrlSafe(byte[])} methods respectively. This method skips any unknown or
362
-
* not supported bytes.
365
+
* tables, please use {@link #decodeBase64Standard(byte[])} or {@link #decodeBase64UrlSafe(byte[])} methods respectively. This method skips unknown or
* This method seamlessly handles data encoded in URL-safe or normal mode. For enforcing verification against strict standard Base64 or Base64 URL-safe
376
-
* tables, please use {@link #decodeBase64Standard(String)} or {@link #decodeBase64UrlSafe(String)} methods respectively. This method skips any unknown or
377
-
* not supported bytes.
380
+
* tables, please use {@link #decodeBase64Standard(String)} or {@link #decodeBase64UrlSafe(String)} methods respectively. This method skips unknown or
* This implementation is aligned with the <a href="https://www.ietf.org/rfc/rfc2045#:~:text=Table%201%3A%20The%20Base64%20Alphabet">RFC 2045 Table 1: The
392
-
* Base64 Alphabet</a>. This method skips any unknown or not supported bytes.
396
+
* Base64 Alphabet</a>. This method skips unknown or unsupported bytes.
* This implementation is aligned with the <a href="https://www.ietf.org/rfc/rfc2045#:~:text=Table%201%3A%20The%20Base64%20Alphabet">RFC 2045 Table 1: The
407
-
* Base64 Alphabet</a>. This method skips any unknown or not supported characters.
411
+
* Base64 Alphabet</a>. This method skips unknown or unsupported characters.
0 commit comments