@@ -3507,25 +3507,30 @@ private static ByteString binaryOperator(
35073507 }
35083508
35093509 /**
3510- * Performs bitwise shift on two integers. Equivalent to: {@code x << (y % 32)} if y >= 0, or
3511- * {@code x >>> (-y % 32)} if y < 0.
3510+ * Performs bitwise shift on two integers.
3511+ * Equivalent to: {@code x << (y % 32)} if y >= 0, or
3512+ * {@code x >>> (-y % 32)} if y < 0.
35123513 */
3514+
35133515 public static int leftShift (int x , int y ) {
35143516 int shift = Math .abs (y % 32 );
35153517 return y >= 0 ? x << shift : x >>> shift ;
35163518 }
35173519
35183520 /**
3519- * Performs bitwise shift on a long. Equivalent to: {@code x << (y % 64)} if y >= 0, or
3520- * {@code x >>> (-y % 64)} if y < 0.
3521+ * Performs bitwise shift on two integers.
3522+ * Equivalent to: {@code x << (y % 64)} if y >= 0, or
3523+ * {@code x >>> (-y % 64)} if y < 0.
35213524 */
3525+
35223526 public static long leftShift (long x , int y ) {
35233527 int shift = Math .abs (y % 64 );
35243528 return y >= 0 ? x << shift : x >>> shift ;
35253529 }
35263530
35273531 /**
3528- * Performs bitwise shift with long shift amount. Note: input x is int, so shift mod 32 is used.
3532+ * Performs bitwise shift with long shift amount.
3533+ * Note: input x is int, so shift mod 32 is used.
35293534 * Returns long to prevent overflow.
35303535 */
35313536 public static long leftShift (int x , long y ) {
@@ -3534,16 +3539,18 @@ public static long leftShift(int x, long y) {
35343539 }
35353540
35363541 /**
3537- * Performs bitwise shift on ByteString input. Returns a new ByteString with shifted bits. If y >=
3538- * 0: left shift; if y < 0: logical right shift.
3542+ * Performs bitwise shift on ByteString input.
3543+ * Returns a new ByteString with shifted bits. If y >=
3544+ * 0: left shift; if y < 0: logical right shift.
35393545 */
35403546 public static ByteString leftShift (ByteString bytes , int y ) {
35413547 byte [] result = leftShift (bytes .getBytes (), y );
35423548 return new ByteString (result );
35433549 }
35443550
35453551 /**
3546- * Performs bitwise shift on byte array. If y >= 0: left shift; if y < 0: logical right shift.
3552+ * Performs bitwise shift on byte array.
3553+ * If y >= 0: left shift; if y < 0: logical right shift.
35473554 * Shift amount is modulo 32 bits.
35483555 */
35493556 public static byte [] leftShift (byte [] bytes , int y ) {
0 commit comments