Nitf File Header
NITF 2.1 / NSIF 1.0 file header (the very first segment of every file). The parser walks the spec-defined positional layout (MIL-STD-2500C §5.2.1) and captures every spec field, but only a few are exposed as typed accessors — the rest are stashed in securityBlock / unparsed for applications that care.
The two non-header outputs that downstream code actually needs are:
the segment offset/length tables (imageSegments, graphicSegments, textSegments, dataExtensionSegments, reservedExtensionSegments).
the file/header lengths so callers can decide whether the byte buffer is a complete file.
Types
Properties
FBKGC — file background colour (R,G,B) in 0..255, NITF 2.1 only.
CLEVEL — file complexity level (3–9 per spec).
ENCRYP — must be "0" in NITF 2.1; we surface for inspection.
Raw XHD bytes (Extended Header Data), or null if XHDL == 0.
FDT — file date/time, CCYYMMDDhhmmss.
Total file length in bytes (FL). May be 999…9 to indicate "not set" — spec §5.2.1.1; we surface the raw value and let callers decide.
Format + version pair (NITF 02.10 or NSIF 01.00).
Header length in bytes (HL) — used to seek past the file header.
Per-image (offset, length) pairs. Offsets are absolute file positions pointing at the IM header byte. Length = LISH + LI.
OSTAID — originating station ID.
ONAME / OPHONE.
Raw 167-byte security block (CLAS/CLSY/CODE/CTLH/REL/DCTP/DCDT/DCXM/DG/ DGDT/CLTX/CATP/CAUT/CRSN/SRDT/CTLN concatenated). Kept around for callers that need to inspect downgrade/release tags.
STYPE — standard type ("BF01" per spec).
Tags consumed by future TRE parsers but currently uninterpreted.
Raw UDHD bytes (User-Defined Header Data), or null if UDHDL == 0.