Example #1
0
 public boolean equals(Object obj) {
   if (obj instanceof ByteArray) {
     ByteArray a = (ByteArray) obj;
     return b.same(a.b, start, end, a.start, a.end);
   } else {
     return false;
   }
 }
Example #2
0
  void writeTo(BytecodeBuffer b) {
    Map sortedMap = new TreeMap();

    for (Iterator i = map.keySet().iterator(); i.hasNext(); ) {
      Object key = i.next(); // ByteArray
      Object value = map.get(key); // Integer
      sortedMap.put(value, key);
    }

    b.writeU32((sortedMap.size() == 0) ? 0 : sortedMap.size() + 1);

    for (Iterator i = sortedMap.keySet().iterator(); i.hasNext(); ) {
      Integer index = (Integer) i.next();
      ByteArray a = (ByteArray) sortedMap.get(index);
      b.writeBytes(a.b, a.start, a.end);
    }
  }
Example #3
0
 void init() {
   hash = b.hashCode(start, end);
 }