Click or drag to resize

RecordFileHeader Class

Represents the header of a record file.
Inheritance Hierarchy
SystemObject
  Ookii.Jumbo.IORecordFileHeader

Namespace:  Ookii.Jumbo.IO
Assembly:  Ookii.Jumbo (in Ookii.Jumbo.dll) Version: 2.0.0
Syntax
public sealed class RecordFileHeader : IWritable

The RecordFileHeader type exposes the following members.

Constructors
  NameDescription
Public methodRecordFileHeader
Initializes a new instance of the RecordFileHeader class that will be initialized using Read(BinaryReader).
Public methodRecordFileHeader(Type, Boolean)
Initializes a new instance of the RecordFileHeader class using the latest version and specified record type.
Top
Properties
  NameDescription
Public propertyRecordType
Gets the type of the records in the file.
Public propertyRecordTypeName
Gets or sets the name of the type of the records in the file.
Public propertyVersion
Gets the version number of the record file format.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetRecordMarker
Gets the record marker for this record file.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

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:

FieldValue
VersionThree bytes containing the ASCII string "REC", followed by a single byte containing the version number of the record file format.
Record type nameThe 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 markerA 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.

See Also