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