Package org.apache.harmony.unpack200

Examples of org.apache.harmony.unpack200.Pack200Exception


     * @throws Pack200Exception
     *             if the minor version is not 7
     */
    private void setArchiveMinorVersion(int version) throws Pack200Exception {
        if (version != 7)
            throw new Pack200Exception("Invalid segment minor version");
        archiveMinor = version;
    }
View Full Code Here


     * @throws Pack200Exception
     *             if the major version is not 150
     */
    private void setArchiveMajorVersion(int version) throws Pack200Exception {
        if (version != 150)
            throw new Pack200Exception("Invalid segment major version: "
                    + version);
        archiveMajor = version;
    }
View Full Code Here

        String[] result1 = new String[sum];
        int[] indices = decodeBandInt(name, in, codec, sum);
        for (int i1 = 0; i1 < sum; i1++) {
            int index = indices[i1];
            if (index < 0 || index >= reference.length)
                throw new Pack200Exception(
                        "Something has gone wrong during parsing references, index = "
                                + index + ", array size = " + reference.length);
            result1[i1] = reference[index];
        }
        String[] refs = result1;
View Full Code Here

        int[] indices = decodeBandInt(name, in, codec, count);
        CPInteger[] result = new CPInteger[indices.length];
        for (int i1 = 0; i1 < count; i1++) {
            int index = indices[i1];
            if (index < 0 || index >= reference.length)
                throw new Pack200Exception(
                        "Something has gone wrong during parsing references, index = "
                                + index + ", array size = " + reference.length);
            result[i1] = segment.getCpBands().cpIntegerValue(index);
        }
        return result;
View Full Code Here

        int[] indices = decodeBandInt(name, in, codec, count);
        CPLong[] result = new CPLong[indices.length];
        for (int i1 = 0; i1 < count; i1++) {
            int index = indices[i1];
            if (index < 0 || index >= reference.length)
                throw new Pack200Exception(
                        "Something has gone wrong during parsing references, index = "
                                + index + ", array size = " + reference.length);
            result[i1] = segment.getCpBands().cpLongValue(index);
        }
        return result;
View Full Code Here

    public ClassFileEntry getValue(int cp, long value) throws Pack200Exception {
        int index = (int) value;
        if (index == -1) {
            return null;
        } else if (index < 0) {
            throw new Pack200Exception("Cannot have a negative range");
        } else if (cp == UTF_8) {
            return bands.cpUTF8Value(index);
        } else if (cp == CP_INT) {
            return bands.cpIntegerValue(index);
        } else if (cp == CP_FLOAT) {
View Full Code Here

            throws Pack200Exception {
        int index = (int) value;
        if (index == -1) {
            return null;
        } else if (index < 0) {
            throw new Pack200Exception("Cannot have a negative range");
        } else if (cp == UTF_8) {
            return bands.cpUTF8Value(index);
        } else if (cp == CP_INT) {
            return bands.cpIntegerValue(index);
        } else if (cp == CP_FLOAT) {
View Full Code Here

        }
        if (removePackFile) {
            File file = new File(inputFileName);
            boolean deleted = file.delete();
            if (!deleted) {
                throw new Pack200Exception("Failed to delete the input file.");
            }
        }
    }
View Full Code Here

            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

            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

TOP

Related Classes of org.apache.harmony.unpack200.Pack200Exception

Copyright © 2018 www.massapicom. 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.