public void writeTo(ByteBuf buf){
    Objects.requireNonNull(buf, "buf should not be null");

    Utils.serializeString(buf, logSegment.getFileName(), Charset.defaultCharset());
    buf.writeLong(logSegment.getFileSize());
    buf.writeInt(indexSegments.size());
    for(FileInfo storeFileInfo : indexSegments){
      storeFileInfo.writeTo(buf);
    }
    buf.writeInt(bloomFilters.size());
    for(FileInfo storeFileInfo : bloomFilters){
      storeFileInfo.writeTo(buf);
    }
  }
Write the LogInfo object to the output stream.
@param buf The output stream.
ambry-api/src/main/java/com/github/ambry/store/StoreLogInfo.java