废话不多说,直接上代码。注释很详细
/**
* 将int类型的值转为byte[]
* @param i 传入的int类型的值
* @return 返回转换后的byte[]的值
* 因为int类型由 4 个字节组成
*/
public byte[] int2Bytes(int i) {
byte[] b = new byte[4];
废话不多说,直接上代码。注释很详细
/**
* 将int类型的值转为byte[]
* @param i 传入的int类型的值
* @return 返回转换后的byte[]的值
* 因为int类型由 4 个字节组成
*/
public byte[] int2Bytes(int i) {
byte[] b = new byte[4];