publicstaticbytebitToByte(String bit){int re, len;if(null == bit){return0;}
len = bit.length();if(len !=4&& len !=8){return0;}if(len ==8){// 8 bit处理 if(bit.charAt(0)=='0'){// 正数
re = Integer.parseInt(bit,2);}else{// 负数
re = Integer.parseInt(bit,2)-256;}}else{//4 bit处理
re = Integer.parseInt(bit,2);}return(byte) re;}