Example #1
0
        private int readIntSafe()
        {
            deficit -= (bb.remaining() << 3);
            int res = 0;

            if (bb.hasRemaining())
            {
                res |= bb.get() & 0xff;
            }
            res <<= 8;
            if (bb.hasRemaining())
            {
                res |= bb.get() & 0xff;
            }
            res <<= 8;
            if (bb.hasRemaining())
            {
                res |= bb.get() & 0xff;
            }
            res <<= 8;
            if (bb.hasRemaining())
            {
                res |= bb.get() & 0xff;
            }
            return(res);
        }