-
Notifications
You must be signed in to change notification settings - Fork 33
Initial commit of packed decimal support #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Nice code and idea! thank you very much! |
|
|
Another thought regarding future expansion...I think there are some additional types that would be convenient to have. One thing lacking is support for strings within the binary data blocks. That should be pretty easy to do, but the question is what to support? Maybe there could be a That also leads to a potential refactoring for specifying settings as additional capabilities are added. For example, instead of a bunch of JBBPParser parser = JBBPParser.builder(script)
.bitOrder(JBBPBitOrder.MSB0)
.byteOrder(JBBPByteOrder.LITTLE_ENDIAN)
.packedDecimalType(JBBPPackedDecimalType.SIGNED)
.charSet(StandardCharsets.UTF_16)
.build();
JBBPFieldStruct result = parser.parse(theBytes);When default settings are used, that would become: JBBPParser parser = JBBPParser.builder(script).build();
JBBPFieldStruct result = parser.parse(theBytes); |
|
the library should work and on mobile platforms so I don't want to add links to external libraries and logging, messages about wrong behaviour should be provided to user through exceptions |
|
Cool...I like the solution for adding custom field types! We'll also need to add support for strings, and we can do that by implementing I had also been working on a separate pull request (just rebased from your new changes) for creating a This is an essential capability for how I'm intending to use the library. Is this something you'd be willing to include, or should I focus on building my own utility class to walk a |
|
in my opinion all what can be formed as extra library should not be included into core because it will provide possibility to users to load and use only what they need and will be working and in mobile devices and in enterprise environment, extra libraries can be oriented to different platforms and include logging and anything else without limit of size, just write me if you need some architecture improvements without which it is impossible to go ahead |
Hello,
Very cool library! I have run across lots of binary message formats that include binary coded decimal (aka packed decimal)...including one I need to support on my current project. So I spent a few hours yesterday and most of today adding BCD support (signed and unsigned) as a field type in the parsing DSL. I added tests for everything I did, and the existing tests are all passing. I hope you'll consider accepting this contribution!
This is not quite complete, as I don't yet have support for BCD using your
@Binannotation. I just ran out of time today, and need to work on something else the rest of the week. I can finish it up later, but would appreciate some pointers on what needs to be done.