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
* BASE32 characters are 5 bits in length. They are formed by taking a block of five octets to form a 40-bit string, which is converted into eight BASE32
* This array is a lookup table that translates Unicode characters drawn from the "Base32 Alphabet" (as specified in Table 3 of RFC 4648) into their 5-bit
55
90
* positive integer equivalents. Characters that are not in the Base32 alphabet but fall within the bounds of the array are translated to -1.
@@ -127,6 +162,16 @@ public class Base32 extends BaseNCodec {
127
162
/** Mask used to extract 1 bits, used when decoding final trailing character. */
128
163
privatestaticfinallongMASK_1BITS = 0x01L;
129
164
165
+
/**
166
+
* Creates a new Builder.
167
+
*
168
+
* @return a new Builder.
169
+
* @since 1.17.0
170
+
*/
171
+
publicstaticBuilderbuilder() {
172
+
returnnewBuilder();
173
+
}
174
+
130
175
// The static final fields above are used for the original static byte[] methods on Base32.
131
176
// The private member fields below are used with the new streaming approach, which requires
132
177
// some state be preserved between calls of encode() and decode().
@@ -262,7 +307,7 @@ public Base32(final int lineLength, final byte[] lineSeparator, final boolean us
262
307
* then the output will not be divided into lines (chunks). Ignored when decoding.
263
308
* @param lineSeparator Each line of encoded data will end with this sequence of bytes.
264
309
* @param useHex if {@code true}, then use Base32 Hex alphabet, otherwise use Base32 alphabet
265
-
* @param padding byte used as padding byte.
310
+
* @param padding padding byte.
266
311
* @throws IllegalArgumentException Thrown when the {@code lineSeparator} contains Base32 characters. Or the lineLength > 0 and lineSeparator is null.
@@ -282,7 +327,7 @@ public Base32(final int lineLength, final byte[] lineSeparator, final boolean us
282
327
* then the output will not be divided into lines (chunks). Ignored when decoding.
283
328
* @param lineSeparator Each line of encoded data will end with this sequence of bytes.
284
329
* @param useHex if {@code true}, then use Base32 Hex alphabet, otherwise use Base32 alphabet
285
-
* @param padding byte used as padding byte.
330
+
* @param padding padding byte.
286
331
* @param decodingPolicy The decoding policy.
287
332
* @throws IllegalArgumentException Thrown when the {@code lineSeparator} contains Base32 characters. Or the lineLength > 0 and lineSeparator is null.
288
333
* @since 1.15
@@ -304,7 +349,7 @@ public Base32(final int lineLength, final byte[] lineSeparator, final boolean us
304
349
* then the output will not be divided into lines (chunks). Ignored when decoding.
305
350
* @param lineSeparator Each line of encoded data will end with this sequence of bytes.
306
351
* @param encodeTable A Base32 alphabet.
307
-
* @param padding byte used as padding byte.
352
+
* @param padding padding byte.
308
353
* @param decodingPolicy The decoding policy.
309
354
* @throws IllegalArgumentException Thrown when the {@code lineSeparator} contains Base32 characters. Or the lineLength > 0 and lineSeparator is null.
310
355
*/
@@ -554,6 +599,15 @@ void encode(final byte[] input, int inPos, final int inAvail, final Context cont
554
599
}
555
600
}
556
601
602
+
/**
603
+
* Gets the line separator (for testing only).
604
+
*
605
+
* @return the line separator.
606
+
*/
607
+
byte[] getLineSeparator() {
608
+
returnlineSeparator;
609
+
}
610
+
557
611
/**
558
612
* Returns whether or not the {@code octet} is in the Base32 alphabet.
0 commit comments