private static byte[] serializeEmptyHashKeys() {
    try {
      // we don't synchronize here: the worst thing that go wrong here is repeated assignment to the same value
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      Encoder encoder = new BinaryEncoder(bos);
      encoder.writeInt(0);
      return bos.toByteArray();
    } catch (IOException e) {
      throw new RuntimeException("encoding empty hash keys went wrong - bailing out: " + e.getMessage(), e);
    }
  }
private static byte [ ] serializeEmptyHashKeys ( ) { try { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; Encoder encoder = new BinaryEncoder ( bos ) ; encoder . writeInt ( 0 ) ; return bos . toByteArray ( ) ; } catch ( IOException e ) { throw new RuntimeException ( "encoding empty hash keys went wrong - bailing out: " + e . getMessage ( ) , e ) ; } }
many entries will have no hash keys. Serialize that once and for good