Examples of Pack200Exception


Examples of org.apache.harmony.pack200.Pack200Exception

            int indexOfStartPC = unrenumbered_start_pcs[index];
            // Given the index of the start_pc, we can now add
            // the encodedLength to it to get the stop index.
            int stopIndex = indexOfStartPC + encodedLength;
            if (stopIndex < 0) {
                throw new Pack200Exception("Error renumbering bytecode indexes");
            }
            // Length can either be an index into the byte code offsets, or one
            // beyond the
            // end of the byte code offsets. Need to determine which this is.
            if (stopIndex == byteCodeOffsets.size()) {
View Full Code Here

Examples of org.apache.harmony.pack200.Pack200Exception

            int indexOfStartPC = unrenumbered_start_pcs[index];
            // Given the index of the start_pc, we can now add
            // the encodedLength to it to get the stop index.
            int stopIndex = indexOfStartPC + encodedLength;
            if (stopIndex < 0) {
                throw new Pack200Exception("Error renumbering bytecode indexes");
            }
            // Length can either be an index into the byte code offsets, or one
            // beyond the
            // end of the byte code offsets. Need to determine which this is.
            if (stopIndex == byteCodeOffsets.size()) {
View Full Code Here

Examples of org.apache.harmony.pack200.Pack200Exception

                return pool.getValue(SegmentConstantPool.CP_LONG, value);
            case 'D': // Double
                return pool.getValue(SegmentConstantPool.CP_DOUBLE, value);
            }
        }
        throw new Pack200Exception("Unknown layout encoding: " + layout);
    }
View Full Code Here

Examples of org.apache.harmony.pack200.Pack200Exception

        } else {
            this.mask = 0;
        }
        if (context != CONTEXT_CLASS && context != CONTEXT_CODE
                && context != CONTEXT_FIELD && context != CONTEXT_METHOD)
            throw new Pack200Exception("Attribute context out of range: "
                    + context);
        if (layout == null) // || layout.length() == 0)
            throw new Pack200Exception("Cannot have a null layout");
        if (name == null || name.length() == 0)
            throw new Pack200Exception("Cannot have an unnamed layout");
        this.name = name;
        this.layout = layout;
        this.isDefault = isDefault;
    }
View Full Code Here

Examples of org.apache.harmony.unpack200.Pack200Exception

            boolean adef = (offset >> 3 & 1) == 1;
            boolean bdef = (offset >> 4 & 1) == 1;
            // If both A and B use the default encoding, what's the point of
            // having a run of default values followed by default values
            if (adef && bdef)
                throw new Pack200Exception(
                        "ADef and BDef should never both be true");
            int kb = (kbflag ? in.read() : 3);
            int k = (kb + 1) * (int) Math.pow(16, kx);
            Codec aCodec, bCodec;
            if (adef) {
                aCodec = defaultCodec;
            } else {
                aCodec = getCodec(in.read(), in, defaultCodec);
            }
            if (bdef) {
                bCodec = defaultCodec;
            } else {
                bCodec = getCodec(in.read(), in, defaultCodec);
            }
            return new RunCodec(k, aCodec, bCodec);
        } else if (value >= 141 && value <= 188) { // Population Codec
            int offset = value - 141;
            boolean fdef = (offset & 1) == 1;
            boolean udef = (offset >> 1 & 1) == 1;
            int tdefl = offset >> 2;
            boolean tdef = tdefl != 0;
            // From section 6.7.3 of spec
            final int[] tdefToL = { 0, 4, 8, 16, 32, 64, 128, 192, 224, 240,
                    248, 252 };
            int l = tdefToL[tdefl];
            // NOTE: Do not re-factor this to bring out uCodec; the order in
            // which
            // they are read from the stream is important
            if (tdef) {
                Codec fCodec = (fdef ? defaultCodec : getCodec(in.read(), in,
                        defaultCodec));
                Codec uCodec = (udef ? defaultCodec : getCodec(in.read(), in,
                        defaultCodec));
                // Unfortunately, if tdef, then tCodec depends both on l and
                // also on k, the
                // number of items read from the fCodec. So we don't know in
                // advance what
                // the codec will be.
                return new PopulationCodec(fCodec, l, uCodec);
            } else {
                Codec fCodec = (fdef ? defaultCodec : getCodec(in.read(), in,
                        defaultCodec));
                Codec tCodec = getCodec(in.read(), in, defaultCodec);
                Codec uCodec = (udef ? defaultCodec : getCodec(in.read(), in,
                        defaultCodec));
                return new PopulationCodec(fCodec, tCodec, uCodec);
            }
        } else {
            throw new Pack200Exception("Invalid codec encoding byte (" + value
                    + ") found");
        }
    }
View Full Code Here

Examples of org.apache.harmony.unpack200.Pack200Exception

            int indexOfStartPC = unrenumbered_start_pcs[index];
            // Given the index of the start_pc, we can now add
            // the encodedLength to it to get the stop index.
            int stopIndex = indexOfStartPC + encodedLength;
            if (stopIndex < 0) {
                throw new Pack200Exception("Error renumbering bytecode indexes");
            }
            // Length can either be an index into the byte code offsets, or one
            // beyond the
            // end of the byte code offsets. Need to determine which this is.
            if (stopIndex == byteCodeOffsets.size()) {
View Full Code Here

Examples of org.apache.harmony.unpack200.Pack200Exception

            int indexOfStartPC = unrenumbered_start_pcs[index];
            // Given the index of the start_pc, we can now add
            // the encodedLength to it to get the stop index.
            int stopIndex = indexOfStartPC + encodedLength;
            if (stopIndex < 0) {
                throw new Pack200Exception("Error renumbering bytecode indexes");
            }
            // Length can either be an index into the byte code offsets, or one
            // beyond the
            // end of the byte code offsets. Need to determine which this is.
            if (stopIndex == byteCodeOffsets.size()) {
View Full Code Here

Examples of org.apache.harmony.unpack200.Pack200Exception

        return cardinality;
    }

    public long decode(InputStream in) throws IOException, Pack200Exception {
        if (d != 0)
            throw new Pack200Exception(
                    "Delta encoding used without passing in last value; this is a coding error");
        return decode(in, 0);
    }
View Full Code Here

Examples of org.apache.harmony.unpack200.Pack200Exception

    public byte[] encode(long value, long last) throws Pack200Exception {
        if (isDelta()) {
            value -= last;
        }
        if (!encodes(value)) {
            throw new Pack200Exception("The codec " + toString()
                    + " does not encode the value " + value);
        }
        long z = value;
        if (isSigned()) {
            if (z < 0) {
View Full Code Here

Examples of org.apache.harmony.unpack200.Pack200Exception

    private final Codec bCodec;
    private long last;

    public RunCodec(int k, Codec aCodec, Codec bCodec) throws Pack200Exception {
        if (k <= 0)
            throw new Pack200Exception(
                    "Cannot have a RunCodec for a negative number of numbers");
        if (aCodec == null || bCodec == null)
            throw new Pack200Exception("Must supply both codecs for a RunCodec");
        this.k = k;
        this.aCodec = aCodec;
        this.bCodec = bCodec;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.