return (double)value;
}
+ public byte[] intToByteArray() {
+ byte[] b = new byte[4];
+ for (int i = 0; i < 4; i++) {
+ int offset = (b.length - 1 - i) * 8;
+ b[i] = (byte) ((value >> offset) & 0xFF);
+ }
+ return b;
+ }
+
+ public int byteArrayToInt(byte [] b) {
+ int val;
+ val = b[0] << 24 + ((b[1] & 0xFF) << 16) + ((b[2] & 0xFF) << 8) + (b[3] & 0xFF);
+ return val;
+ }
+
public static int parseInt(String str) {
return Integer.parseInt(str, 10);
}