Hello everybody :) I am currently using preon for a spare time project, and I have encountered the following problem: I am trying to read a fixed length String with the following code:
@Bound int string_size;
@ByteAlign @BoundString(size = "string_size") my_string;
The file specification expects a variable padding, so that the next block's offset is a multiple of 4. For example, if string_size = 5, then 3 null bytes will be added, and so on. I initially thought that the @ByteAlign annotation did exactly this, however, looking into the source code, I realized that it wasn't the case.
I tried to make this quick fix:
@If ("string_size % 4 == 2") @BoundList(size = "2", type = Byte.class) byte[] padding;
Sadly, Limbo doesn't seem to support the "%" operator. Is there a way around this?
(Also, where/how can I get the latest version?) Thanks in advance.