摘要: [java]view plaincopypublicclassDataTypeChangeHelper{/***将一个单字节的byte转换成32位的int**@paramb*byte*@returnconvertresult*/publicstaticintunsignedByteToInt(byteb){return(int)b&0xFF;}/***将一个单字节的Byte转换成十六进制的数**@paramb*byte*@returnconvertresult*/publicstaticStringbyteToHex(byteb){inti=b&0xFF;returnInteg 阅读全文
posted @ 2012-06-13 13:03 怡馨 阅读(21675) 评论(0) 推荐(0) 编辑
摘要: public byte[] intToByte(int i) { byte[] abyte0 = new byte[4]; abyte0[0] = (byte) (0xff & i); abyte0[1] = (byte) ((0xff00 & i) >> 8); abyte0[2] = (byte) ((0xff0000 & i) >> 16); abyte0[3] = (byte) ((0xff000000 & i) >> 24); return abyte0; } public static int bytesToInt 阅读全文
posted @ 2012-06-13 13:02 怡馨 阅读(546) 评论(0) 推荐(0) 编辑