Package org.apache.harmony.pack200

Examples of org.apache.harmony.pack200.Pack200Exception


        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


            // TODO This breaks if file_size > 2^32. Probably an array is
            // not the right choice, and we should just serialize it here?
            fileBits[i] = new byte[size];
            int read = in.read(fileBits[i]);
            if (size != 0 && read < size) {
                throw new Pack200Exception("Expected to read " + size
                        + " bytes but read " + read);
            }
        }
    }
View Full Code Here

                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

        } 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

     * @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

     * @throws Pack200Exception
     *             if an unused bit (bit 3 or bit 13+) is non-zero
     */
    public SegmentOptions(int options) throws Pack200Exception {
        if ((options & UNUSED) != 0)
            throw new Pack200Exception("Some unused flags are non-zero");
        this.options = options;
    }
View Full Code Here

                AttributeLayout layout1 = (AttributeLayout) l.get(j);
                for (int j2 = j + 1; j2 < l.size(); j2++) {
                    AttributeLayout layout2 = (AttributeLayout) l.get(j2);
                    if (layout1.getName().equals(layout2.getName())
                            && layout1.getLayout().equals(layout2.getLayout())) {
                        throw new Pack200Exception(
                                "Same layout/name combination: "
                                        + layout1.getLayout()
                                        + "/"
                                        + layout1.getName()
                                        + " exists twice for context: "
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

TOP

Related Classes of org.apache.harmony.pack200.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.