2010. 6. 29. 17:27
public static int byteToInt(byte[] src) {
int newValue = 0;
newValue |= (((int)src[0])<<24)&0xFF000000;
newValue |= (((int)src[1])<<16)&0xFF0000;
newValue |= (((int)src[2])<<8)&0xFF00;
newValue |= (((int)src[3]))&0xFF;
DebugPrint.writeDebug("aaaa : " + newValue);
return newValue;
}
int newValue = 0;
newValue |= (((int)src[0])<<24)&0xFF000000;
newValue |= (((int)src[1])<<16)&0xFF0000;
newValue |= (((int)src[2])<<8)&0xFF00;
newValue |= (((int)src[3]))&0xFF;
DebugPrint.writeDebug("aaaa : " + newValue);
return newValue;
}
'java > util' 카테고리의 다른 글
[java] - 타입 변환 (0) | 2010.06.30 |
---|---|
[java] - 외부 프로그램 실행하기.. (0) | 2010.06.29 |
[java] - int to byte array (0) | 2010.06.29 |
[java] - Big Endian to Little Endian (0) | 2010.06.29 |
[java] - Little Endian to Big Endian (0) | 2010.06.29 |