Ejemplo n.º 1
0
  private void readNamePool() throws IOException {
    int count = in.readVU30();

    ABC.Names names = abcFile.namePool(count);
    for (int i = 1; i < count; i++) {
      readName(names);
    }
    if (names != null) names.done();
  }
Ejemplo n.º 2
0
  private void readName(ABC.Names names) throws IOException {

    MultiNameKind kind = MultiNameKind.parse(in);
    int nameIndex = 0;
    int namespaceIndex = 0;
    int nsSetIndex = 0;

    switch (kind) {
      case Qname:
      case QnameA:
        {
          namespaceIndex = in.readVU30();
          nameIndex = in.readVU30();
          break;
        }

      case RTQname:
      case RTQnameA:
        {
          nameIndex = in.readVU30();
          break;
        }

      case RTQnameL:
      case RTQnameLA:
        {
          break;
        }

      case Multiname:
      case MultinameA:
        {
          nameIndex = in.readVU30();
          nsSetIndex = in.readVU30();
          break;
        }

      case MultinameL:
      case MultinameLA:
        {
          nsSetIndex = in.readVU30();
          break;
        }

      case GenericName:
        {
          int typeIndex = in.readVU30();
          int count = in.readVU30();
          int[] typeParamIndices = new int[count];
          for (int i = 0; i < typeParamIndices.length; i++) {
            typeParamIndices[i] = in.readVU30();
          }

          if (names != null) names.genericName(kind, typeIndex, typeParamIndices);
          return;
        }

      default:
        throw new IOException("Unknown name kind: " + kind);
    }

    if (names != null) names.name(kind, nameIndex, namespaceIndex, nsSetIndex);
  }