static CompactionDetails fromBytes(DataInputStream stream) throws IOException {
    CompactionDetails details;
    short version = stream.readShort();
    switch (version) {
      case VERSION_0:
      case VERSION_1:
        long referenceTime = stream.readLong();
        boolean isFullRange = false;
        if (version == VERSION_1) {
          byte b = stream.readByte();
          isFullRange = b == (byte) 1;
        }
        int segmentCount = stream.readInt();
        List<LogSegmentName> logSegmentsUnderCompaction = new ArrayList<>();
        for (int i = 0; i < segmentCount; i++) {
          logSegmentsUnderCompaction.add(LogSegmentName.fromString(Utils.readIntString(stream)));
        }
        details = new CompactionDetails(referenceTime, logSegmentsUnderCompaction, null, isFullRange);
        break;
      default:
        throw new IllegalArgumentException("Unrecognized version: " + version);
    }
    return details;
  }
@param stream the serialized version of the {@link CompactionDetails} that has to be loaded.
@return a representation of all the details required for compaction from the given {@code stream}.
@throws IllegalArgumentException if the version is not recognized
@throws IOException if there is an I/O error reading from the stream
ambry-store/src/main/java/com/github/ambry/store/CompactionDetails.java