wspringer/preon — Issue #6: Binding a Binary-coded decimal
Author: kaefert
Created: 2012-02-18 08:47:22+00:00
State: open

Hi there!

This is sort of a feature request.. I would like to bind a binary coded decimal.
In my case I want to read a date, If I look at this area of my samplefile with a hex editor I can see this: "19 91 05 10"
So what I want is to get this information in some meaningfull way.
Maybe 4 int variables which will be filled with 19, 91, 05 and 10, and I will then do the rest in a getter method.

So what I found I can do right now is to bind this area of my file with
@BoundString(size="4") String dateString;

with this the eclipse debugger will show me this funny chars that have their hex-code written inside them, except for 91 which is apearantly encoding a funny questionmark.

Have I overlooked some way of doing this or could you implement something like this for me?

p.s. I'm using the Snapshot-1.1 since I used this getting-started guide from here --> http://preon.codehaus.org/getting-started.html to generate me a sample project