@@ -65,7 +65,7 @@ public final class BitUtils {
6565 * @param pByte
6666 * byte read
6767 */
68- public BitUtils (final byte pByte [] ) {
68+ public BitUtils (final byte [] pByte ) {
6969 byteTab = new byte [pByte .length ];
7070 System .arraycopy (pByte , 0 , byteTab , 0 , pByte .length );
7171 size = pByte .length * BYTE_SIZE ;
@@ -144,11 +144,7 @@ public byte getMask(final int pIndex, final int pLength) {
144144 * @return true or false
145145 */
146146 public boolean getNextBoolean () {
147- boolean ret = false ;
148- if (getNextInteger (1 ) == 1 ) {
149- ret = true ;
150- }
151- return ret ;
147+ return getNextInteger (1 ) == 1 ;
152148 }
153149
154150 /**
@@ -284,7 +280,7 @@ public long getNextLongSigned(final int pLength) {
284280 throw new IllegalArgumentException ("Long overflow with length > 64" );
285281 }
286282 long decimal = getNextLong (pLength );
287- long signMask = 1 << pLength - 1 ;
283+ long signMask = 1L << pLength - 1 ;
288284
289285 if ( (decimal & signMask ) != 0 ) {
290286 return - (signMask - (signMask ^ decimal ));
@@ -487,7 +483,7 @@ public void setNextByte(final byte[] pValue, final int pLength, final boolean pP
487483 buffer .put ((byte ) 0 );
488484 }
489485 }
490- byte tab [] = buffer .array ();
486+ byte [] tab = buffer .array ();
491487 if (currentBitIndex % BYTE_SIZE != 0 ) {
492488 int index = 0 ;
493489 int max = currentBitIndex + pLength ;
@@ -588,7 +584,7 @@ public void setNextLong(final long pValue, final int pLength) {
588584 * @param pMaxSize
589585 * max size in bits
590586 */
591- protected void setNextValue (final long pValue , final int pLength , final int pMaxSize ) {
587+ private void setNextValue (final long pValue , final int pLength , final int pMaxSize ) {
592588 long value = pValue ;
593589 // Set to max value if pValue cannot be stored on pLength bits.
594590 long bitMax = (long ) Math .pow (2 , Math .min (pLength , pMaxSize ));
0 commit comments