protected long clampLong(long l, long minClamp, long maxClamp, Long... exceptions) {
        if (maxClamp < minClamp) {
            throw new IllegalArgumentException("maxClamp < minClamp not allowed");
        }
        if (exceptions != null) {
            if (exceptions.length % 2 != 0) {
                throw new IllegalArgumentException("exceptions must be pairs of (flag, replacement) longs");
            }
        }
        boolean clamp = true;
        if (exceptions != null) {
            for (int ii = 0; ii < exceptions.length; ii += 2) {
                if (l == exceptions[ii]) {
                    l = exceptions[ii+1];
                    clamp = false;
                    break;
                }
            }
        }
        if (clamp) {
            if (l < minClamp) {
                l = minClamp;
            } else if (l > maxClamp) {
                l = maxClamp;
            }
        }
        return l;
    }
Returns the underlying byte provider.
@return the underlying byte provider
GPL/DMG/src/dmg/java/mobiledevices/dmg/ghidra/GBinaryReader.java