public static int readInt(InputStream inputStream) throws IOException {
        byte[] byteArray = new byte[4];

        // Read in the next 4 bytes
        inputStream.read(byteArray);

        int number = convertIntFromBytes(byteArray);

        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