I need to parse and encode to a legacy binary message format in Java. I began by using DataOutputStream to read/write primitive types but the problem I\'m having is that the mes
with Java Binary Block Parser the script to parse the message will be
class Parsed {
@Bin int field1;
@Bin (type = BinType.BIT) boolean field2;
@Bin(type = BinType.BIT) boolean field3;
@Bin int field4;
@Bin(type = BinType.BIT) int enums;
@Bin(type = BinType.UBYTE_ARRAY) String str;
}
Parsed parsed = JBBPParser.prepare("int field1; bit field2; bit field3; int field4; bit:4 enums; ubyte [32] str;").parse(STREAM).mapTo(Parsed.class);