Convert byte[] into int

Hey!How to convert a byte vector to an int? Byte[] to int?ThanksMikael
[105 byte] By [ironmajka] at [2007-10-3 10:31:08]
# 1
If you want to build an integer value out of four bytes, then I guess you'll need the left shift operator (<<) and bitwise inclusive OR operator (|)
TimTheEnchantora at 2007-7-15 5:53:54 > top of Java-index,Java Essentials,Java Programming...
# 2
int someInt = (int)byte[index];a BYTE is 8-bits and an int is 32-bits (4-bytes), so the data type will fit.
watertownjordana at 2007-7-15 5:53:54 > top of Java-index,Java Essentials,Java Programming...
# 3
In fact, to save space, you could fit 4 byte objects into 1 int object, get a BitSet from the int, and simply doll it out at 8-bits/byte when reading.Neat huh.
watertownjordana at 2007-7-15 5:53:54 > top of Java-index,Java Essentials,Java Programming...