Preon doesn't handle variable length fields decoding. It seems to me that the @Slice annotation would be perfect for doing this. An attribute 'until' would allow to read until this attribute value is met in the buffer.
For exemple, to decode the following byte chain {1, 44, 35, 65, 98, 44, 3, -50,60} between each byte of value 44 we could have :
@Slice(until={(byte)44})
@BoundList(type=byte.class) private byte[] list1; -> 1
@BoundBuffer(match={(byte)44}) private byte[] fieldSeparator; ->44
@Slice(until={(byte)44})
@BoundList(type=byte.class) private byte[] list2; -> 35, 65, 98
@BoundBuffer(match={(byte)44}) private byte[] fieldSeparator; ->44
@Slice(until={(byte)44})
@BoundList(type=byte.class) private byte[] list3; -> 3, -50,60
Thank you !