Package org.apache.harmony.archive.internal.pack200

Examples of org.apache.harmony.archive.internal.pack200.Pack200Exception


    for(int i=0;i<fields.length;i++) {
      // write method info
    }
    dos.writeShort(attributes.length);
    for(int i=0;i<attributes.length;i++) {
      Attribute a = attributes[i];
      a.write(dos);
    }
  }
View Full Code Here


    classFile.superClass = cp.indexOf(cfSuper);
    // TODO placate format of file for writing purposes
    classFile.interfaces = new int[0];
    classFile.fields = new int[0];
    classFile.methods = new int[0];
    SourceFile sf;
    classFile.attributes = new ClassFileEntry.Attribute[] { sf = new ClassFileEntry.SourceFile(classThis[classNum+ ".java") };
    cp.add(sf);

    // sort CP according to cp_All
    cp.resolve();
View Full Code Here


public abstract class ClassFileEntry {
  static abstract class Attribute extends ClassFileEntry {
    public Attribute(String attributeName) {
      this.attributeName = new UTF8(attributeName);
    }
View Full Code Here

  static class SourceFile extends Attribute {
    private UTF8 name;
    public int nameIndex;
    public SourceFile(String name) {
      super("SourceFile"); //$NON-NLS-1$
      this.name = new UTF8(name);
    }
View Full Code Here

  public Object getValue(long value, Segment segment) throws Pack200Exception {
    if (layout.startsWith("R")) {
      // references
      if (layout.indexOf('N') != -1)
        value--;
      SegmentConstantPool pool = segment.getConstantPool();
      if (layout.startsWith("RU")) {
        return pool.getValue(SegmentConstantPool.UTF_8, value);
      } else if (layout.startsWith("RS")) {
        return pool.getValue(SegmentConstantPool.SIGNATURE, value);
      }
    }
    throw new Pack200Exception("Unknown layout encoding: " + layout);
  }
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

        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

TOP

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