IBlockIndexFormat

Description

[ShutdownSurvive]
interface Tinman.Core.Database.IBlockIndexFormat<T>

Base interface for classes that provide a binary representation of index values for a BlockIndex.

Frequently used block index nodes are kept in memory, where values are stored as TValue values. Block index nodes are serialized to the underlying persistent store using the ValueRead and ValueWrite method.

Public / Methods

Value​Read


public method ValueRead → (1)

stream in : IDataStream

[not-null]
The data stream.

returns → T

The read value.

Reads a single value from the given stream.

The method is expected to read exactly ValueBytes from the stream in.

IOException

If an I/O error has occurred.

Value​Write


public method ValueWrite → (2)

stream in : IDataStream

[not-null]
The data stream.

value in : T

The value to write.

Writes a single value to the given stream.

The method is expected to write exactly ValueBytes to the stream in.

IOException

If an I/O error has occurred.

Public / Attributes

Value​Bytes


public attribute ValueBytes → (get)

value : int32

[>0]
The number of bytes per value.

Returns the number of bytes used to encode a value.