PageSourceSearch

https://www.techwriter.ai/assets/js/7b11d6ae.ea68967c.js

js techwriter.ai collected 2026-10-05 15:18:21 UTC 21,937 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkshowcase=self.webpackChunkshowcase||[]).push([["8175"],{8855(e,n,i){i.r(n),i.d(n,{metadata:()=>s,default:()=>o,frontMatter:()=>r,contentTitle:()=>l,toc:()=>a,assets:()=>c});var s=JSON.parse('{"id":"ksy-language/data-types","title":"Data types","description":"Reference for the primitive data types in the Kaitai Struct .ksy language \u2014 integers, floats, byte arrays, strings, and bit-sized integers, with endianness and sizing rules.","source":"@site/content/kaitai/ksy-language/data-types.md","sourceDirName":"ksy-language","slug":"/ksy-language/data-types","permalink":"/kaitai/ksy-language/data-types","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedAt":1782864000000,"sidebarPosition":2,"frontMatter":{"sidebar_position":2,"title":"Data types","description":"Reference for the primitive data types in the Kaitai Struct .ksy language \u2014 integers, floats, byte arrays, strings, and bit-sized integers, with endianness and sizing rules.","autoscribe_synced":"2026-08-09","last_update":{"date":"2026-07-01T00:00:00.000Z"}},"sidebar":"kaitaiSidebar","previous":{"title":"Anatomy of a .ksy file","permalink":"/kaitai/ksy-language/structure"},"next":{"title":"Attributes & instances","permalink":"/kaitai/ksy-language/attributes-and-instances"}}'),t=i(4848),d=i(8453);let r={sidebar_position:2,title:"Data types",description:"Reference for the primitive data types in the Kaitai Struct .ksy language \u2014 integers, floats, byte arrays, strings, and bit-sized integers, with endianness and sizing rules.",autoscribe_synced:"2026-08-09",last_update:{date:new Date("2026-07-01T00:00:00.000Z")}},l="Data types",c={},a=[{value:"Integers",id:"integers",level:2},{value:"Endianness",id:"endianness",level:3},{value:"Floating-point numbers",id:"floating-point-numbers",level:2},{value:"Byte arrays",id:"byte-arrays",level:2},{value:"Strings",id:"strings",level:2},{value:"Bit-sized integers",id:"bit-sized-integers",level:2},{value:"Quick reference",id:"quick-reference",level:2},{value:"Sources",id:"sources",level:2}];function h(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,d.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"data-types",children:"Data types"})}),"\n",(0,t.jsxs)(n.p,{children:["A ",(0,t.jsx)(n.code,{children:".ksy"})," file is a YAML document that describes how to parse a binary format. The\ncore of any description is the ",(0,t.jsx)(n.code,{children:"seq"})," section, a list of attributes that are read\nin order from the stream. Each attribute usually carries a ",(0,t.jsx)(n.code,{children:"type"})," key that tells\nthe compiler how many bytes to read and how to interpret them."]}),"\n",(0,t.jsx)(n.p,{children:"This page covers the built-in primitive types: integers, floating-point numbers,\nraw byte arrays, strings, and bit-sized integers. User-defined types and enums are\ndocumented separately."}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsxs)(n.p,{children:["Type names in Kaitai Struct encode both the kind of value and its width. For\nexample, ",(0,t.jsx)(n.code,{children:"u4"})," is an unsigned 4-byte integer and ",(0,t.jsx)(n.code,{children:"s2"})," is a signed 2-byte integer.\nThe leading letter is the kind; the trailing digit is the size in bytes."]})}),"\n",(0,t.jsx)(n.h2,{id:"integers",children:"Integers"}),"\n",(0,t.jsxs)(n.p,{children:["Kaitai Struct provides fixed-width signed and unsigned integers. The first letter\nis ",(0,t.jsx)(n.code,{children:"u"})," (unsigned) or ",(0,t.jsx)(n.code,{children:"s"})," (signed); the number is the byte width."]}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Signedness"}),(0,t.jsx)(n.th,{children:"Size (bytes)"}),(0,t.jsx)(n.th,{children:"Range"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"u1"})}),(0,t.jsx)(n.td,{children:"unsigned"}),(0,t.jsx)(n.td,{children:"1"}),(0,t.jsx)(n.td,{children:"0 \u2026 255"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"u2"})}),(0,t.jsx)(n.td,{children:"unsigned"}),(0,t.jsx)(n.td,{children:"2"}),(0,t.jsx)(n.td,{children:"0 \u2026 65 535"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"u4"})}),(0,t.jsx)(n.td,{children:"unsigned"}),(0,t.jsx)(n.td,{children:"4"}),(0,t.jsx)(n.td,{children:"0 \u2026 4 294 967 295"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"u8"})}),(0,t.jsx)(n.td,{children:"unsigned"}),(0,t.jsx)(n.td,{children:"8"}),(0,t.jsx)(n.td,{children:"0 \u2026 18 446 744 073 709 551 615"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"s1"})}),(0,t.jsx)(n.td,{children:"signed"}),(0,t.jsx)(n.td,{children:"1"}),(0,t.jsx)(n.td,{children:"\u2212128 \u2026 127"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"s2"})}),(0,t.jsx)(n.td,{children:"signed"}),(0,t.jsx)(n.td,{children:"2"}),(0,t.jsx)(n.td,{children:"\u221232 768 \u2026 32 767"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"s4"})}),(0,t.jsx)(n.td,{children:"signed"}),(0,t.jsx)(n.td,{children:"4"}),(0,t.jsx)(n.td,{children:"\u22122 147 483 648 \u2026 2 147 483 647"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"s8"})}),(0,t.jsx)(n.td,{children:"signed"}),(0,t.jsx)(n.td,{children:"8"}),(0,t.jsx)(n.td,{children:"\u22129 223 372 036 854 775 808 \u2026 9 223 372 036 854 775 807"})]})]})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"seq:\n  - id: record_count\n    type: u4\n  - id: temperature\n    type: s2\n"})}),"\n",(0,t.jsx)(n.h3,{id:"endianness",children:"Endianness"}),"\n",(0,t.jsxs)(n.p,{children:["Multi-byte integers need an endianness: big-endian (",(0,t.jsx)(n.code,{children:"be"}),", most significant byte\nfirst) or little-endian (",(0,t.jsx)(n.code,{children:"le"}),", least significant byte first). There are two ways\nto set it."]}),"\n",(0,t.jsxs)(n.p,{children:["Set a default for the whole type with ",(0,t.jsx)(n.code,{children:"meta/endian"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"meta:\n  id: my_format\n  endian: be\nseq:\n  - id: width\n    type: u4   # read as big-endian, per meta/endian\n  - id: height\n    type: u4\n"})}
1),"\n",(0,t.jsxs)(n.p,{children:["Or append a suffix to a single field to override the default (or to specify\nendianness when no ",(0,t.jsx)(n.code,{children:"meta/endian"})," is set):"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"seq:\n  - id: network_order\n    type: u4be   # big-endian\n  - id: intel_order\n    type: u4le   # little-endian\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"u1"})," and ",(0,t.jsx)(n.code,{children:"s1"})," are single-byte values, so endianness does not apply to them and no\nsuffix is needed. You only need ",(0,t.jsx)(n.code,{children:"le"}),"/",(0,t.jsx)(n.code,{children:"be"})," for types that are 2 bytes or wider."]})}),"\n",(0,t.jsx)(n.h2,{id:"floating-point-numbers",children:"Floating-point numbers"}),"\n",(0,t.jsxs)(n.p,{children:["Floats follow IEEE 754. The digit is the byte width: ",(0,t.jsx)(n.code,{children:"f4"})," is single precision\n(32-bit) and ",(0,t.jsx)(n.code,{children:"f8"})," is double precision (64-bit). Endianness is specified the same\nway as for integers \u2014 through ",(0,t.jsx)(n.code,{children:"meta/endian"})," or a per-field ",(0,t.jsx)(n.code,{children:"le"}),"/",(0,t.jsx)(n.code,{children:"be"})," suffix."]}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Precision"}),(0,t.jsx)(n.th,{children:"Size (bytes)"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"f4"})}),(0,t.jsx)(n.td,{children:"single (IEEE 754)"}),(0,t.jsx)(n.td,{children:"4"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"f8"})}),(0,t.jsx)(n.td,{children:"double (IEEE 754)"}),(0,t.jsx)(n.td,{children:"8"})]})]})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"seq:\n  - id: scale_factor\n    type: f4\n  - id: latitude\n    type: f8le   # little-endian double\n"})}),"\n",(0,t.jsx)(n.h2,{id:"byte-arrays",children:"Byte arrays"}),"\n",(0,t.jsxs)(n.p,{children:["A raw byte array is an attribute with ",(0,t.jsxs)(n.strong,{children:["no ",(0,t.jsx)(n.code,{children:"type"})," key"]}),". You must tell the\ncompiler how many bytes to read; one of the sizing keys below is mandatory."]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"size"})," \u2014 a fixed number, or an expression referencing an earlier field."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"size-eos: true"})," \u2014 read all remaining bytes to the end of the stream."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"terminator"})," \u2014 read up to (and by default consuming) a delimiter byte."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"contents"})," key is a related but distinct mechanism: it asserts a fixed,\nknown sequence of bytes. With ",(0,t.jsx)(n.code,{children:"contents"})," there is no need to specify ",(0,t.jsx)(n.code,{children:"size"})," \u2014\nthe length comes naturally from the listed bytes."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"seq:\n  - id: magic\n    contents: [0x89, 0x50, 0x4e, 0x47]   # PNG signature; parsing fails if it does not match\n  - id: uuid\n    size: 16\n  - id: payload\n    size: len_payload                    # length taken from an earlier field\n  - id: trailing\n    size-eos: true                       # everything left in the stream\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"contents"})," key accepts a list of byte values (decimal or hex) and may also\ncontain string literals, which are expanded to their byte values. If the bytes in\nthe stream do not match, parsing raises a validation error \u2014 this is how format\nsignatures and magic numbers are checked."]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"size"})," and ",(0,t.jsx)(n.code,{children:"size-eos"})," are mutually exclusive ways of bounding a field. Use ",(0,t.jsx)(n.code,{children:"size"}),"\nwhen the length is known or computed, and ",(0,t.jsx)(n.code,{children:"size-eos"})," only for the final field that\nshould consume whatever remains."]})}),"\n",(0,t.jsx)(n.h2,{id:"strings",children:"Strings"}),"\n",(0,t.jsxs)(n.p,{children:["Strings are byte arrays decoded into text. Use ",(0,t.jsx)(n.code,{children:"type: str"})," and supply an\n",(0,t.jsx)(n.code,{children:"encoding"})," (for example ",(0,t.jsx)(n.code,{children:"ASCII"}),", ",(0,t.jsx)(n.code,{children:"UTF-8"}),", ",(0,t.jsx)(n.code,{children:"UTF-16LE"}),", ",(0,t.jsx)(n.code,{children:"ISO-8859-1"}),"). A string\nstill needs a length, which you provide with the same sizing mechanisms as byte\narrays, or with a terminator byte."]}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Key"}),(0,t.jsx)(n.th,{children:"Meaning"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"encoding"})}),(0,t.jsxs)(n.td,{children:["Character encoding used to decode the bytes (required, unless set via ",(0,t.jsx)(n.code,{children:"meta/encoding"}),")."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"size"})}),(0,t.jsx)(n.td,{children:"Fixed length in bytes."})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"size-eos"})}),(0,t.jsx)(n.td,{children:"Read to the end of the stream."})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"terminator"})}),(0,t.jsx)(n.td,{children:"A single byte value that ends the string."})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"include"})}),(0,t.jsxs)(n.td,{children:["Whether the terminator byte is included in the value (default ",(0,t.jsx)(n.code,{children:"false"}),")."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"consume"})}),(0,t.jsxs)(n.td,{children:["Whether the stream position advances past the terminator (default ",(0,t.jsx)(n.code,{children:"true"}),")."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"eos-error"})}),(0,t.jsxs)(n.td,{children:["Whether reaching end-of-stream without finding the terminator is an error (default ",(0,t.jsx)(n.code,{children:"true"}),")."]})]})]})]}
1),"\n",(0,t.jsx)(n.p,{children:"Fixed-size string:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"seq:\n  - id: signature\n    type: str\n    size: 4\n    encoding: ASCII\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Terminated string. ",(0,t.jsx)(n.code,{children:"type: strz"})," is shorthand for a string terminated by a zero\nbyte (",(0,t.jsx)(n.code,{children:"terminator: 0"}),") \u2014 the classic C-style null-terminated string:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"seq:\n  - id: filename\n    type: strz\n    encoding: UTF-8\n"})}),"\n",(0,t.jsx)(n.p,{children:"A custom terminator, with the size-limiting keys spelled out (illustrative\nexample):"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"seq:\n  - id: line\n    type: str\n    encoding: UTF-8\n    terminator: 0x0a   # newline ends the string\n    include: false     # do not keep the newline in the value\n    consume: true      # advance past the newline\n    eos-error: false   # tolerate a final line with no trailing newline\n"})}),"\n",(0,t.jsxs)(n.p,{children:["You can combine ",(0,t.jsx)(n.code,{children:"size"})," and ",(0,t.jsx)(n.code,{children:"terminator"}),": the field reads exactly ",(0,t.jsx)(n.code,{children:"size"})," bytes, but\nthe decoded string stops at the terminator if one appears earlier. This models\nfixed-width, null-padded string fields:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"seq:\n  - id: name\n    type: str\n    size: 16\n    terminator: 0\n    encoding: ASCII\n"})}),"\n",(0,t.jsxs)(n.admonition,{type:"tip",children:[(0,t.jsxs)(n.p,{children:["To avoid repeating ",(0,t.jsx)(n.code,{children:"encoding:"})," on every string, set a default once with\n",(0,t.jsx)(n.code,{children:"meta/encoding"}),". Per-field ",(0,t.jsx)(n.code,{children:"encoding:"})," still overrides it where needed."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"meta:\n  id: my_format\n  encoding: UTF-8\n"})})]}),"\n",(0,t.jsx)(n.h2,{id:"bit-sized-integers",children:"Bit-sized integers"}),"\n",(0,t.jsxs)(n.p,{children:["When a format packs values into fewer than 8 bits \u2014 flags, small enums, version\nnibbles \u2014 use ",(0,t.jsx)(n.code,{children:"bN"}),", where ",(0,t.jsx)(n.code,{children:"N"})," is the number of bits. For example ",(0,t.jsx)(n.code,{children:"b1"})," reads a\nsingle bit (commonly treated as a boolean), ",(0,t.jsx)(n.code,{children:"b3"})," reads three bits, and ",(0,t.jsx)(n.code,{children:"b13"})," reads\nthirteen bits spanning more than one byte."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"meta:\n  id: my_format\n  bit-endian: be\nseq:\n  - id: version\n    type: b4    # high nibble\n  - id: header_len\n    type: b4    # low nibble\n  - id: flag\n    type: b1    # single bit\n  - id: reserved\n    type: b11   # spans into the next byte\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Bit fields are read most-conveniently when you declare the bit order with\n",(0,t.jsx)(n.code,{children:"meta/bit-endian"}),":"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"bit-endian: be"})," \u2014 bits fill each byte from the most significant bit toward the\nleast significant."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"bit-endian: le"})," \u2014 bits fill from the least significant bit toward the most\nsignificant."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["You can also override the bit order on an individual field with a ",(0,t.jsx)(n.code,{children:"be"}),"/",(0,t.jsx)(n.code,{children:"le"}),"\nsuffix, for example ",(0,t.jsx)(n.code,{children:"b5le"})," or ",(0,t.jsx)(n.code,{children:"b3be"}),"."]}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsxs)(n.p,{children:["Bit-sized parsing keeps an internal sub-byte position. When a non-bit type (such\nas ",(0,t.jsx)(n.code,{children:"u2"})," or a byte array) follows bit fields, the reader aligns back to a byte\nboundary before reading it. Keep this in mind when mixing bit fields with\nbyte-aligned fields in the same ",(0,t.jsx)(n.code,{children:"seq"}),"."]})}
1),"\n",(0,t.jsx)(n.h2,{id:"quick-reference",children:"Quick reference"}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Category"}),(0,t.jsx)(n.th,{children:"Types"}),(0,t.jsx)(n.th,{children:"Size"}),(0,t.jsx)(n.th,{children:"Notes"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Unsigned integer"}),(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"u1"}),", ",(0,t.jsx)(n.code,{children:"u2"}),", ",(0,t.jsx)(n.code,{children:"u4"}),", ",(0,t.jsx)(n.code,{children:"u8"})]}),(0,t.jsx)(n.td,{children:"1\u20138 bytes"}),(0,t.jsxs)(n.td,{children:["Append ",(0,t.jsx)(n.code,{children:"le"}),"/",(0,t.jsx)(n.code,{children:"be"})," for 2+ byte widths"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Signed integer"}),(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"s1"}),", ",(0,t.jsx)(n.code,{children:"s2"}),", ",(0,t.jsx)(n.code,{children:"s4"}),", ",(0,t.jsx)(n.code,{children:"s8"})]}),(0,t.jsx)(n.td,{children:"1\u20138 bytes"}),(0,t.jsxs)(n.td,{children:["Append ",(0,t.jsx)(n.code,{children:"le"}),"/",(0,t.jsx)(n.code,{children:"be"})," for 2+ byte widths"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Float"}),(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"f4"}),", ",(0,t.jsx)(n.code,{children:"f8"})]}),(0,t.jsx)(n.td,{children:"4 / 8 bytes"}),(0,t.jsxs)(n.td,{children:["IEEE 754; endianness via suffix or ",(0,t.jsx)(n.code,{children:"meta/endian"})]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Byte array"}),(0,t.jsxs)(n.td,{children:["(no ",(0,t.jsx)(n.code,{children:"type"}),")"]}),(0,t.jsx)(n.td,{children:"variable"}),(0,t.jsxs)(n.td,{children:["Requires ",(0,t.jsx)(n.code,{children:"size"}),", ",(0,t.jsx)(n.code,{children:"size-eos"}),", or ",(0,t.jsx)(n.code,{children:"terminator"})," (or use ",(0,t.jsx)(n.code,{children:"contents"})," for fixed bytes)"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"String"}),(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"str"}),", ",(0,t.jsx)(n.code,{children:"strz"})]}),(0,t.jsx)(n.td,{children:"variable"}),(0,t.jsxs)(n.td,{children:["Needs ",(0,t.jsx)(n.code,{children:"encoding"}),"; bound by ",(0,t.jsx)(n.code,{children:"size"}),"/",(0,t.jsx)(n.code,{children:"size-eos"}),"/",(0,t.jsx)(n.code,{children:"terminator"})]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"Bit integer"}),(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"b1"})," \u2026 ",(0,t.jsx)(n.code,{children:"bN"})]}),(0,t.jsx)(n.td,{children:"N bits"}),(0,t.jsxs)(n.td,{children:["Set order with ",(0,t.jsx)(n.code,{children:"meta/bit-endian"})," (or ",(0,t.jsx)(n.code,{children:"bNle"}),"/",(0,t.jsx)(n.code,{children:"bNbe"}),")"]})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"sources",children:"Sources"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://doc.kaitai.io/user_guide.html",children:"Kaitai Struct User Guide"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://doc.kaitai.io/ksy_reference.html",children:"KSY reference"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://doc.kaitai.io/serialization.html",children:"Serialization Guide"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://formats.kaitai.io/",children:"Kaitai Struct format gallery"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://github.com/kaitai-io/kaitai_struct",children:"kaitai-io/kaitai_struct (README)"})}),"\n"]})]})}function o(e={}){let{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},8453(e,n,i){i.d(n,{R:()=>r,x:()=>l});var s=i(6540);let t={},d=s.createContext(t);function r(e){let n=s.useContext(d);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),s.createElement(d.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.