コード例 #1
0
ファイル: ABCParser.java プロジェクト: dbwelch/j2swf
  /** Parse the contents of the file - calling endABC at the end */
  public void parse() throws IOException {
    int minor = in.readUI16();
    int major = in.readUI16();
    abcFile.version(major, minor);

    readIntPool();
    readUIntPool();
    readDoublePool();
    readStringPool();
    readNamespacePool();
    readNSSetPool();
    readNamePool();
    readMethodInfos();
    readMetadata();

    int count = in.readVU30();
    ABC.ClassInfos classInfos = abcFile.classes(count);
    readInstanceInfos(classInfos, count);
    readClassInfos(classInfos, count);
    if (classInfos != null) classInfos.done();

    readScripts();
    readMethodBodies();

    abcFile.done();
  }
コード例 #2
0
ファイル: ABCParser.java プロジェクト: dbwelch/j2swf
 private void readClassInfos(ABC.ClassInfos classInfos, int count) throws IOException {
   for (int i = 0; i < count; i++) {
     int staticConsIndex = in.readVU30();
     int traitCount = in.readVU30();
     ABC.Traits traits =
         (classInfos != null) ? classInfos.classInfo(staticConsIndex, traitCount) : null;
     readTraits(traitCount, traits);
   }
 }
コード例 #3
0
ファイル: ABCParser.java プロジェクト: dbwelch/j2swf
  private void readInstanceInfos(ABC.ClassInfos classInfos, int count) throws IOException {
    for (int i = 0; i < count; i++) {

      int nameIndex = in.readVU30();
      int superIndex = in.readVU30();
      int flags = in.readUI8();

      int protectedNS = 0;
      if (InstanceInfoFlags.HasProtectedNS.isSet(flags)) {
        protectedNS = in.readVU30();
      }

      int ifaceCount = in.readVU30();
      int[] interfaces = new int[ifaceCount];
      for (int j = 0; j < interfaces.length; j++) {
        interfaces[j] = in.readVU30();
      }

      int constructorIndex = in.readVU30();

      int traitCount = in.readVU30();
      ABC.Traits traits =
          (classInfos != null)
              ? classInfos.instanceInfo(
                  nameIndex,
                  superIndex,
                  flags,
                  protectedNS,
                  interfaces,
                  constructorIndex,
                  traitCount)
              : null;

      readTraits(traitCount, traits);
    }
  }