public final int fetchBinaryUInt(int size) throws EParseError {
        if ((size == 0) || (pos + size > length))
            throw new EParseError("Out of range"); // TODO: special exception

        int r = 0;
        int b;

        b = src[pos++];
        r = (b & 0xFF);
        if (size == 1) return r;

        b = src[pos++] & 0xFF;
        r = (r<<8) | b;
        if (size == 2) return r;

        b = src[pos++] & 0xFF;
        r = (r<<8) | b;
        if (size == 3) return r;

        b = src[pos++] & 0xFF;
        r = (r<<8) | b;
        if (size == 4) return r;

        throw
            new EParseError("Invalid bytes length");

    }