@@ -60,10 +60,9 @@ public class Base32 extends BaseNCodec {
6060 private static final byte [] CHUNK_SEPARATOR = {'\r' , '\n' };
6161
6262 /**
63- * This array is a lookup table that translates Unicode characters drawn from the "Base32 Alphabet" (as specified in
64- * Table 3 of RFC 2045) into their 5-bit positive integer equivalents. Characters that are not in the Base32
63+ * This array is a lookup table that translates Unicode characters drawn from the "Base32 Alphabet" (as specified
64+ * in Table 3 of RFC 2045) into their 5-bit positive integer equivalents. Characters that are not in the Base32
6565 * alphabet but fall within the bounds of the array are translated to -1.
66- *
6766 */
6867 private static final byte [] DECODE_TABLE = {
6968 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
@@ -86,10 +85,9 @@ public class Base32 extends BaseNCodec {
8685 };
8786
8887 /**
89- * This array is a lookup table that translates Unicode characters drawn from the "Base32 |Hex Alphabet" (as specified in
90- * Table 3 of RFC 2045) into their 5-bit positive integer equivalents. Characters that are not in the Base32 Hex
91- * alphabet but fall within the bounds of the array are translated to -1.
92- *
88+ * This array is a lookup table that translates Unicode characters drawn from the "Base32 |Hex Alphabet" (as
89+ * specified in Table 3 of RFC 2045) into their 5-bit positive integer equivalents. Characters that are not in the
90+ * Base32 Hex alphabet but fall within the bounds of the array are translated to -1.
9391 */
9492 private static final byte [] HEX_DECODE_TABLE = {
9593 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
@@ -102,8 +100,8 @@ public class Base32 extends BaseNCodec {
102100 };
103101
104102 /**
105- * This array is a lookup table that translates 5-bit positive integer index values into their "Base32 Hex Alphabet"
106- * equivalents as specified in Table 3 of RFC 2045.
103+ * This array is a lookup table that translates 5-bit positive integer index values into their
104+ * "Base32 Hex Alphabet" equivalents as specified in Table 3 of RFC 2045.
107105 */
108106 private static final byte [] HEX_ENCODE_TABLE = {
109107 '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' ,
@@ -122,6 +120,7 @@ public class Base32 extends BaseNCodec {
122120 * Place holder for the bytes we're dealing with for our based logic.
123121 * Bitwise operations store and extract the encoding or decoding from this variable.
124122 */
123+
125124 /**
126125 * Convenience variable to help us determine when our buffer is going to run out of room and needs resizing.
127126 * <code>decodeSize = {@link #BYTES_PER_ENCODED_BLOCK} - 1 + lineSeparator.length;</code>
@@ -178,8 +177,9 @@ public Base32(boolean useHex) {
178177 * </p>
179178 *
180179 * @param lineLength
181- * Each line of encoded data will be at most of the given length (rounded down to nearest multiple of 8).
182- * If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when decoding.
180+ * Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
181+ * 8). If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when
182+ * decoding.
183183 */
184184 public Base32 (int lineLength ) {
185185 this (lineLength , CHUNK_SEPARATOR );
@@ -195,8 +195,9 @@ public Base32(int lineLength) {
195195 * </p>
196196 *
197197 * @param lineLength
198- * Each line of encoded data will be at most of the given length (rounded down to nearest multiple of 8).
199- * If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when decoding.
198+ * Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
199+ * 8). If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when
200+ * decoding.
200201 * @param lineSeparator
201202 * Each line of encoded data will end with this sequence of bytes.
202203 * @throws IllegalArgumentException
@@ -216,14 +217,16 @@ public Base32(int lineLength, byte[] lineSeparator) {
216217 * </p>
217218 *
218219 * @param lineLength
219- * Each line of encoded data will be at most of the given length (rounded down to nearest multiple of 8).
220- * If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when decoding.
220+ * Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
221+ * 8). If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when
222+ * decoding.
221223 * @param lineSeparator
222224 * Each line of encoded data will end with this sequence of bytes.
223- * @param useHex if {@code true}, then use Base32 Hex alphabet, otherwise use Base32 alphabet
225+ * @param useHex
226+ * if {@code true}, then use Base32 Hex alphabet, otherwise use Base32 alphabet
224227 * @throws IllegalArgumentException
225- * The provided lineSeparator included some Base32 characters. That's not going to work!
226- * Or the lineLength > 0 and lineSeparator is null.
228+ * The provided lineSeparator included some Base32 characters. That's not going to work! Or the
229+ * lineLength > 0 and lineSeparator is null.
227230 */
228231 public Base32 (int lineLength , byte [] lineSeparator , boolean useHex ) {
229232 super (BYTES_PER_UNENCODED_BLOCK , BYTES_PER_ENCODED_BLOCK ,
@@ -297,7 +300,8 @@ void decode(byte[] in, int inPos, int inAvail, Context context) { // package pro
297300 int result = this .decodeTable [b ];
298301 if (result >= 0 ) {
299302 context .modulus = (context .modulus +1 ) % BYTES_PER_ENCODED_BLOCK ;
300- context .lbitWorkArea = (context .lbitWorkArea << BITS_PER_ENCODED_BYTE ) + result ; // collect decoded bytes
303+ // collect decoded bytes
304+ context .lbitWorkArea = (context .lbitWorkArea << BITS_PER_ENCODED_BYTE ) + result ;
301305 if (context .modulus == 0 ) { // we can output the 5 bytes
302306 context .buffer [context .pos ++] = (byte ) ((context .lbitWorkArea >> 32 ) & MASK_8BITS );
303307 context .buffer [context .pos ++] = (byte ) ((context .lbitWorkArea >> 24 ) & MASK_8BITS );
0 commit comments