//时 代 J a v a 公 众 号 - nowjava.com 提供
//package com.nowjava;
public class Main {
public static void main(String[] argv) throws Exception {
byte b = 2;
int count = 2;
System.out.println(circularBitShiftLeft(b, count));
}
public static byte circularBitShiftLeft(byte b, int count) {
if (count < 0)
count = count * -1;
/**
时 代 J a v a - N o w J a v a . c o m 提供
**/
if (count > 7)
count = count % 8;
if (count == 0)
return b;
if (b >= 0)
return (byte) ((b << count) | (b >>> Byte.SIZE - count));
else {
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。