NitfFileHeader

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

Link copied to clipboard
object Companion
Link copied to clipboard
data class SegmentLocation(val headerOffset: Int, val headerLength: Int, val dataLength: Long)

Position + size of a segment inside the file. headerLength is the subheader (LISH/LSSH/LTSH/LDSH/LRESH), dataLength is the segment data (LI/LS/LT/LD/LRE).

Properties

Link copied to clipboard

FBKGC — file background colour (R,G,B) in 0..255, NITF 2.1 only.

Link copied to clipboard

CLEVEL — file complexity level (3–9 per spec).

Link copied to clipboard

ENCRYP — must be "0" in NITF 2.1; we surface for inspection.

Link copied to clipboard

Raw XHD bytes (Extended Header Data), or null if XHDL == 0.

Link copied to clipboard

FDT — file date/time, CCYYMMDDhhmmss.

Link copied to clipboard

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.

Link copied to clipboard

Format + version pair (NITF 02.10 or NSIF 01.00).

Link copied to clipboard

Header length in bytes (HL) — used to seek past the file header.

Link copied to clipboard

Per-image (offset, length) pairs. Offsets are absolute file positions pointing at the IM header byte. Length = LISH + LI.

Link copied to clipboard

OSTAID — originating station ID.

Link copied to clipboard

ONAME / OPHONE.

Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard

STYPE — standard type ("BF01" per spec).

Link copied to clipboard

FTITLE — free-text title.

Link copied to clipboard

Tags consumed by future TRE parsers but currently uninterpreted.

Link copied to clipboard

Raw UDHD bytes (User-Defined Header Data), or null if UDHDL == 0.