int转byte数组publicstaticbyte[]intToBytes2(intn){byte[]b=newbyte[4];for(inti=0;i<4;i++){b[i]=(byte)(n>>(24-i*8));}returnb;}byte转换为intpublicstaticintbyteToInt2(byte[]b){intmask=0xff;inttemp=0;intn=0;for(inti=0;i<b.length;i++){n<<=8;temp=b[i]&mask;n|=temp;}returnn;}
1200字范文,内容丰富有趣,写作的好帮手!