You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use a child class for parsing will throw java.lang.IllegalStateException: There is not any opened struct. Below are my test code. @bin @Getter @Setter
public class Parent { @bin(order = 1, type = BinType.USHORT, comment = "Size of package header")
int headerSize;
}
@bin @Getter @Setter
public class Child extends Parent { @bin(order = 2, type = BinType.BYTE_ARRAY, arraySizeExpr = "1024")
String body;
}
public class Test {
@Test
public void testParse() {
byte[] data = new byte[] {0x12, 0x34, 0x56, 0x7F};
final JBBPParser parser = JBBPParser.prepare(JBBPDslBuilder.Begin().AnnotatedClass(Child.class).End());
JBBPFieldStruct parsed = parser.parse(data);
final MenuPackageTwo parsedPackage = parsed.findFieldForNameAndType("Child", JBBPFieldStruct.class).mapTo(new Child());
}
}
The text was updated successfully, but these errors were encountered:
When I use a child class for parsing will throw java.lang.IllegalStateException: There is not any opened struct. Below are my test code.
@bin
@Getter
@Setter
public class Parent {
@bin(order = 1, type = BinType.USHORT, comment = "Size of package header")
int headerSize;
}
@bin
@Getter
@Setter
public class Child extends Parent {
@bin(order = 2, type = BinType.BYTE_ARRAY, arraySizeExpr = "1024")
String body;
}
public class Test {
}
}
The text was updated successfully, but these errors were encountered: