public static int convertIntFromBytes(byte[] byteArray, int offset) {
        // Convert it to an int
        int number = ((byteArray[offset] & 0xFF) << 24)
                + ((byteArray[offset+1] & 0xFF) << 16) + ((byteArray[offset+2] & 0xFF) << 8)
                + (byteArray[offset+3] & 0xFF);
        return number;
    }
Read in an integer from an InputStream

@param inputStream
           The InputStream used to read the integer
@return An int, which is the next 4 bytes converted from the InputStream
@throws IOException
            Thrown if there is a problem reading from the InputStream
jme3-core/src/plugins/java/com/jme3/export/binary/ByteUtils.java