Table of Contents

Class FitsHeaderWriter

Namespace
FitsModel.FitsStream.Writer
Assembly
FitsModel.dll

Reads FitsDataBlocks until a complete FitsHeader is formed, then forwards it to any registered IFitsHeaderReader instances.

public class FitsHeaderWriter : DataBlockWriterBase, IFitsDataBlockWriter
Inheritance
FitsHeaderWriter
Implements
Inherited Members

Constructors

FitsHeaderWriter()

public FitsHeaderWriter()

Properties

CurrentEntries

Collection of FitsHeaderEntries that have been read from the data blocks so far. This will be cleared once a complete FitsHeader is formed.

public List<FitsHeaderEntry> CurrentEntries { get; }

Property Value

List<FitsHeaderEntry>

Header

If not null, this will contain the FitsHeader that was read from the data blocks. Note, no more data can be written to this writer after the header is set.

public FitsHeader? Header { get; }

Property Value

FitsHeader

Methods

AddHeaderReader(IFitsHeaderReader)

Registers a new IFitsHeaderReader instance to receive the parsed FitsHeader.

public void AddHeaderReader(IFitsHeaderReader headerReader)

Parameters

headerReader IFitsHeaderReader

Exceptions

ArgumentNullException

WriteDataBlock(FitsDataBlock)

Interprets the data blocks as FiitsHeaderEntries, collecting them until a complete header is formed. Once a complete header is formed, it is forwarded to all registered IFitsHeaderReader instances. An exception is thrown if a data block is written after the header is set.

public override void WriteDataBlock(FitsDataBlock dataBlock)

Parameters

dataBlock FitsDataBlock

The data block containing FitsHeaderEntries

Exceptions

ArgumentNullException

Thrown if dataBlock is null.

FitsModelException

Thrown if we have already parsed a full FitsHeader