@Override
  public String toString() {
    return "(File: [" + file + " ], Capacity: [" + capacityInBytes + "], Start offset: [" + startOffset
        + "], End offset: [" + endOffset + "])";
  }
Writes a header describing the segment.
@param capacityInBytes the intended capacity of the segment.
@throws StoreException if there is any store exception while writing to the file.
ambry-store/src/main/java/com/github/ambry/store/LogSegment.java