@@ -175,19 +175,19 @@ public Builder setHexEncodeTable(final boolean useHex) {
175175 // @formatter:on
176176
177177 /** Mask used to extract 5 bits, used when encoding Base32 bytes */
178- private static final int MASK_5BITS = 0x1f ;
178+ private static final int MASK_5_BITS = 0x1f ;
179179
180180 /** Mask used to extract 4 bits, used when decoding final trailing character. */
181- private static final long MASK_4BITS = 0x0fL ;
181+ private static final long MASK_4_BITS = 0x0fL ;
182182
183183 /** Mask used to extract 3 bits, used when decoding final trailing character. */
184- private static final long MASK_3BITS = 0x07L ;
184+ private static final long MASK_3_BITS = 0x07L ;
185185
186186 /** Mask used to extract 2 bits, used when decoding final trailing character. */
187- private static final long MASK_2BITS = 0x03L ;
187+ private static final long MASK_2_BITS = 0x03L ;
188188
189189 /** Mask used to extract 1 bits, used when decoding final trailing character. */
190- private static final long MASK_1BITS = 0x01L ;
190+ private static final long MASK_1_BITS = 0x01L ;
191191
192192 // The static final fields above are used for the original static byte[] methods on Base32.
193193 // The private member fields below are used with the new streaming approach, which requires
@@ -484,7 +484,7 @@ void decode(final byte[] input, int inPos, final int inAvail, final Context cont
484484 validateTrailingCharacters ();
485485 // falls-through
486486 case 2 : // 10 bits, drop 2 and output one byte
487- validateCharacter (MASK_2BITS , context );
487+ validateCharacter (MASK_2_BITS , context );
488488 buffer [context .pos ++] = (byte ) (context .lbitWorkArea >> 2 & MASK_8BITS );
489489 break ;
490490 case 3 : // 15 bits, drop 7 and output 1 byte, or raise an exception
@@ -493,13 +493,13 @@ void decode(final byte[] input, int inPos, final int inAvail, final Context cont
493493 buffer [context .pos ++] = (byte ) (context .lbitWorkArea >> 7 & MASK_8BITS );
494494 break ;
495495 case 4 : // 20 bits = 2*8 + 4
496- validateCharacter (MASK_4BITS , context );
496+ validateCharacter (MASK_4_BITS , context );
497497 context .lbitWorkArea = context .lbitWorkArea >> 4 ; // drop 4 bits
498498 buffer [context .pos ++] = (byte ) (context .lbitWorkArea >> 8 & MASK_8BITS );
499499 buffer [context .pos ++] = (byte ) (context .lbitWorkArea & MASK_8BITS );
500500 break ;
501501 case 5 : // 25 bits = 3*8 + 1
502- validateCharacter (MASK_1BITS , context );
502+ validateCharacter (MASK_1_BITS , context );
503503 context .lbitWorkArea = context .lbitWorkArea >> 1 ;
504504 buffer [context .pos ++] = (byte ) (context .lbitWorkArea >> 16 & MASK_8BITS );
505505 buffer [context .pos ++] = (byte ) (context .lbitWorkArea >> 8 & MASK_8BITS );
@@ -514,7 +514,7 @@ void decode(final byte[] input, int inPos, final int inAvail, final Context cont
514514 buffer [context .pos ++] = (byte ) (context .lbitWorkArea & MASK_8BITS );
515515 break ;
516516 case 7 : // 35 bits = 4*8 +3
517- validateCharacter (MASK_3BITS , context );
517+ validateCharacter (MASK_3_BITS , context );
518518 context .lbitWorkArea = context .lbitWorkArea >> 3 ;
519519 buffer [context .pos ++] = (byte ) (context .lbitWorkArea >> 24 & MASK_8BITS );
520520 buffer [context .pos ++] = (byte ) (context .lbitWorkArea >> 16 & MASK_8BITS );
@@ -558,8 +558,8 @@ void encode(final byte[] input, int inPos, final int inAvail, final Context cont
558558 case 0 :
559559 break ;
560560 case 1 : // Only 1 octet; take top 5 bits then remainder
561- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 3 ) & MASK_5BITS ]; // 8-1*5 = 3
562- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea << 2 ) & MASK_5BITS ]; // 5-3=2
561+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 3 ) & MASK_5_BITS ]; // 8-1*5 = 3
562+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea << 2 ) & MASK_5_BITS ]; // 5-3=2
563563 buffer [context .pos ++] = pad ;
564564 buffer [context .pos ++] = pad ;
565565 buffer [context .pos ++] = pad ;
@@ -568,33 +568,33 @@ void encode(final byte[] input, int inPos, final int inAvail, final Context cont
568568 buffer [context .pos ++] = pad ;
569569 break ;
570570 case 2 : // 2 octets = 16 bits to use
571- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 11 ) & MASK_5BITS ]; // 16-1*5 = 11
572- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 6 ) & MASK_5BITS ]; // 16-2*5 = 6
573- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 1 ) & MASK_5BITS ]; // 16-3*5 = 1
574- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea << 4 ) & MASK_5BITS ]; // 5-1 = 4
571+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 11 ) & MASK_5_BITS ]; // 16-1*5 = 11
572+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 6 ) & MASK_5_BITS ]; // 16-2*5 = 6
573+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 1 ) & MASK_5_BITS ]; // 16-3*5 = 1
574+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea << 4 ) & MASK_5_BITS ]; // 5-1 = 4
575575 buffer [context .pos ++] = pad ;
576576 buffer [context .pos ++] = pad ;
577577 buffer [context .pos ++] = pad ;
578578 buffer [context .pos ++] = pad ;
579579 break ;
580580 case 3 : // 3 octets = 24 bits to use
581- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 19 ) & MASK_5BITS ]; // 24-1*5 = 19
582- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 14 ) & MASK_5BITS ]; // 24-2*5 = 14
583- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 9 ) & MASK_5BITS ]; // 24-3*5 = 9
584- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 4 ) & MASK_5BITS ]; // 24-4*5 = 4
585- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea << 1 ) & MASK_5BITS ]; // 5-4 = 1
581+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 19 ) & MASK_5_BITS ]; // 24-1*5 = 19
582+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 14 ) & MASK_5_BITS ]; // 24-2*5 = 14
583+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 9 ) & MASK_5_BITS ]; // 24-3*5 = 9
584+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 4 ) & MASK_5_BITS ]; // 24-4*5 = 4
585+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea << 1 ) & MASK_5_BITS ]; // 5-4 = 1
586586 buffer [context .pos ++] = pad ;
587587 buffer [context .pos ++] = pad ;
588588 buffer [context .pos ++] = pad ;
589589 break ;
590590 case 4 : // 4 octets = 32 bits to use
591- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 27 ) & MASK_5BITS ]; // 32-1*5 = 27
592- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 22 ) & MASK_5BITS ]; // 32-2*5 = 22
593- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 17 ) & MASK_5BITS ]; // 32-3*5 = 17
594- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 12 ) & MASK_5BITS ]; // 32-4*5 = 12
595- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 7 ) & MASK_5BITS ]; // 32-5*5 = 7
596- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 2 ) & MASK_5BITS ]; // 32-6*5 = 2
597- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea << 3 ) & MASK_5BITS ]; // 5-2 = 3
591+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 27 ) & MASK_5_BITS ]; // 32-1*5 = 27
592+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 22 ) & MASK_5_BITS ]; // 32-2*5 = 22
593+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 17 ) & MASK_5_BITS ]; // 32-3*5 = 17
594+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 12 ) & MASK_5_BITS ]; // 32-4*5 = 12
595+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 7 ) & MASK_5_BITS ]; // 32-5*5 = 7
596+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 2 ) & MASK_5_BITS ]; // 32-6*5 = 2
597+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea << 3 ) & MASK_5_BITS ]; // 5-2 = 3
598598 buffer [context .pos ++] = pad ;
599599 break ;
600600 default :
@@ -616,14 +616,14 @@ void encode(final byte[] input, int inPos, final int inAvail, final Context cont
616616 }
617617 context .lbitWorkArea = (context .lbitWorkArea << 8 ) + b ; // BITS_PER_BYTE
618618 if (0 == context .modulus ) { // we have enough bytes to create our output
619- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 35 ) & MASK_5BITS ];
620- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 30 ) & MASK_5BITS ];
621- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 25 ) & MASK_5BITS ];
622- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 20 ) & MASK_5BITS ];
623- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 15 ) & MASK_5BITS ];
624- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 10 ) & MASK_5BITS ];
625- buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 5 ) & MASK_5BITS ];
626- buffer [context .pos ++] = encodeTable [(int ) context .lbitWorkArea & MASK_5BITS ];
619+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 35 ) & MASK_5_BITS ];
620+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 30 ) & MASK_5_BITS ];
621+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 25 ) & MASK_5_BITS ];
622+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 20 ) & MASK_5_BITS ];
623+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 15 ) & MASK_5_BITS ];
624+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 10 ) & MASK_5_BITS ];
625+ buffer [context .pos ++] = encodeTable [(int ) (context .lbitWorkArea >> 5 ) & MASK_5_BITS ];
626+ buffer [context .pos ++] = encodeTable [(int ) context .lbitWorkArea & MASK_5_BITS ];
627627 context .currentLinePos += BYTES_PER_ENCODED_BLOCK ;
628628 if (lineLength > 0 && lineLength <= context .currentLinePos ) {
629629 System .arraycopy (lineSeparator , 0 , buffer , context .pos , lineSeparator .length );
0 commit comments