Method WriteHeader
WriteHeader(DataOutput, String, Int32)
Writes a codec header, which records both a string to identify the file and a version number. This header can be parsed and validated with CheckHeader(DataInput, String, Int32, Int32).
CodecHeader --> Magic,CodecName,Version
- Magic --> Uint32 (WriteInt32(Int32)). this identifies the start of the header. It is always CODEC_MAGIC.
- CodecName --> String (WriteString(String)). this is a string to identify this file.
- Version --> Uint32 (WriteInt32(Int32)). Records the version of the file.
Note that the length of a codec header depends only upon the name of the codec, so this length can be computed at any time with HeaderLength(String).
Declaration
public static void WriteHeader(DataOutput out, string codec, int version)
Parameters
Type | Name | Description |
---|---|---|
DataOutput | out | Output stream |
System.String | codec | String to identify this file. It should be simple ASCII, less than 128 characters in length. |
System.Int32 | version | Version number |