public int hashKey(K value) { try { DataByteArrayOutputStream os = new DataByteArrayOutputStream(); keyCodec.encode(value, os); return hash(os.toBuffer()); } catch (IOException e) { throw new RuntimeException(e); } }
public int hashNode(N node, int i) { try { DataByteArrayOutputStream os = new DataByteArrayOutputStream(); nodeCodec.encode(node, os); os.write(':'); os.writeInt(i); return hash(os.toBuffer()); } catch (IOException e) { throw new RuntimeException(e); } }