use java to parse the binary struct of "C/C++"
if you have a gay colleague, he is the R&D position of "C/C++", because of some businesses, he wrote binary files using structure.
view the following c/c++ code
you need to read this binary file, but you only know "java" language.
you: "oh, my God, what should I do"
don't worry, j2struct helps you. XDDDDDDDDDD
view the following java code
is it very cool?
it may also be very backward! XDDDDDDD
J2Struct.readStruct(); or J2Struct.readSturctAutoAlign(); not StructUtil
if your Class needs to be used as a structure object, use annotation @Struct(index=0).
your Class attribute needs to be used as a structure attribute. please use the corresponding annotation. the index configuration represents the order of attributes in the structure
j2struct can not only read struct binary, but also write struct binary!
j2struct supports all basic types