public static MessageHeader_Format getMessageHeader(short headerVersion, ByteBuffer input)
      throws MessageFormatException {
    switch (headerVersion) {
      case Message_Header_Version_V1:
        return new MessageHeader_Format_V1(input);
      case Message_Header_Version_V2:
        return new MessageHeader_Format_V2(input);
      case Message_Header_Version_V3:
        return new MessageHeader_Format_V3(input);
      default:
        throw new MessageFormatException("Unknown header version: " + headerVersion,
            MessageFormatErrorCodes.UnknownFormatVersion);
    }
  }
Format a header for the given version using the given content.
@param headerVersion the version of the header.
@param input the input content that is to be formatted in the appropriate header version.
@return a formatted header for the given version.
@throws MessageFormatException if the given header version is invalid.
ambry-messageformat/src/main/java/com/github/ambry/messageformat/MessageFormatRecord.java