how to achieve limited "look ahead" for calc of offset to endian flag
Hello,

Apologies if this is the wrong venue for questions, but... I am working on a project to implement a Kaitai Struct reader for a [complicated storage format](https://casacore.github.io/casacore-notes/260.pdf).

I would like to use the [endian calc](https://doc.kaitai.io/user_guide.html#calc-endian) feature, but the endian key occurs **after** useful metadata (_convenient!_). This is the start of the metadata spec:

```ksy
seq:
    - id: magic
      contents: [ 0xbe, 0xbe, 0xbe, 0xbe ]
      doc: |
        casa magic unsigned int 3200171710  190 190 190 190
    - id: size
      type: u4
    - id: type
      type: string
    - id: version
      type: u4
    - id: nrows
      type:
          switch-on: version
          cases:
            1: u4
            2: u4
            3: u8
    - id: little_endian
      size: 4
```
The 4 `little_endian` bytes will be either `[ 0x0, 0x0, 0x0, 0x0]` or `[ 0x0, 0x0, 0x0, 0x1]`. What is the best way to handle this need to "look ahead" to determine the _endianness_ to be able to get the proper `size` and `version` values? The extended metadata ksy (with  _endianness_ hard-coded) can be found [here](https://github.com/radio-astro-tools/casa-formats-specification/blob/main/src/tablestream/templates/metadata.ksy).

Many thanks, in advance, for any help.