RecordFileHeader Class |
Namespace: Ookii.Jumbo.IO
The RecordFileHeader type exposes the following members.
Name | Description | |
---|---|---|
RecordFileHeader |
Initializes a new instance of the RecordFileHeader class that will be initialized using Read(BinaryReader).
| |
RecordFileHeader(Type, Boolean) |
Initializes a new instance of the RecordFileHeader class using the latest version and specified record type.
|
Name | Description | |
---|---|---|
RecordType |
Gets the type of the records in the file.
| |
RecordTypeName |
Gets or sets the name of the type of the records in the file.
| |
Version |
Gets the version number of the record file format.
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetRecordMarker |
Gets the record marker for this record file.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
A record file is a plain file containing a sequence of records, with an occasional record marker to make it possible to start reading at any point in the file and find the next record marker so you can start reading from the beginning of a record.
Record markers are 16 bytes random values created with the cryptographic RandomNumberGenerator for maximum entropy.
A record file begins with a header, which uses the following format:
Field | Value |
---|---|
Version | Three bytes containing the ASCII string "REC", followed by a single byte containing the version number of the record file format. |
Record type name | The assembly qualified name of the type of the records, as a utf-8 encoded string, preceded by the string length (this is the format used by Write(String). |
Record marker | A 16-byte value specifying the record marker for this file. |
After the header, a sequence of records follows. Each record is preceded by a 4 byte record prefix which is an integer in little endian format. If this prefix is -1, it is followed by a record marker, and not a record. Otherwise the prefix is followed by a record, which will be read by the record types Read(BinaryReader) implementation.
In future versions, the record prefix may be used for other information (such as the record size), but currently it will always be either -1 to indicate a record marker, or 0 to indicate a record.