private HashMapSegmentLayout segmentForKey(int key) throws IOException {
    checkNotClosed();

    int hash = hash(key);
    int segmentIndex = header.segmentIndexByHash(hash);

    HashMapSegmentLayout layout = segmentsCache.get(segmentIndex);
    if (layout == null) {
      layout = new HashMapSegmentLayout(bufferSource, segmentIndex, header.segmentSize());
      segmentsCache.put(segmentIndex, layout);
    }
    return layout;
  }
private HashMapSegmentLayout segmentForKey(int key)