My problem is, that I want to parse binary files of different types with a generic parser which is implemented in JAVA. Maybe describing the file format with a configuration
Using Preon:
public class File {
@BoundString(match="MAGIC")
private String header;
@BoundList(size="10", type=Body.class)
private List body;
private static class Body {
@Bound
byte value1;
@Bound
long value2;
@BoundString(size="10")
String value3;
}
}
Decoding data:
Codec codec = Codecs.create(File.class);
File file = codecs.decode(codec, buffer);
Let me know if you are running into problems.