Ejemplo n.º 1
0
 private void writeStringTable(PackedDataOutputStream stream) throws IOException {
   stream.writePackedU32(pool.size());
   Iterator<String> iter = pool.iterator();
   while (iter.hasNext()) {
     String string = iter.next();
     stream.writeUTF(string);
   }
 }
Ejemplo n.º 2
0
  private void writeClassTable(PackedDataOutputStream stream) throws IOException {
    stream.writePackedU32(classTable.size());

    // Zero is reserved for null
    int pos = 1;
    for (Map.Entry<DotName, Integer> entry : classTable.entrySet()) {
      entry.setValue(pos++);
      DotName name = entry.getKey();
      assert !name.isComponentized();

      int nameDepth = 0;
      for (DotName prefix = name.prefix(); prefix != null; prefix = prefix.prefix()) nameDepth++;

      stream.writePackedU32(nameDepth);
      stream.writeUTF(name.local());
    }
  }