code: @SneakyThrows(IOException.class)
      static ByteArraySegment serialize(RollingSegmentHandle handle) {
          try (EnhancedByteArrayOutputStream os = new EnhancedByteArrayOutputStream()) {
              //1. Policy Max Size.
              os.write(combine(KEY_POLICY_MAX_SIZE, Long.toString(handle.getRollingPolicy().getMaxLength())));
              //2. Chunks.
              handle.chunks().forEach(chunk -> os.write(serializeChunk(chunk)));
              return os.getData();
          }
      }
docs: Serializes an entire RollingSegmentHandle into a new ByteArraySegment.
  
  @param handle The RollingSegmentHandle to serialize.
  @return A ByteArraySegment with the serialization.