Closed bibmaster closed 1 year ago
Any updates on this? Would be very great to have this in master
@bibmaster This part contains two reallocations
byte[] valueBytes = Arrays.copyOfRange(byteCode, 1, byteCode.length);
String str = new String(valueBytes, StandardCharsets.US_ASCII);
Maybe replace it with
String str = new String(byteCode, 1, byteCode.length - 1, StandardCharsets.US_ASCII);
yes, this looks good. Thanks for contribution and sorry for taking so long.
8.5.5 Bit 8 of the first contents octet shall be set as follows: ... b) if bit 8 = 0 and bit 7 = 0, then the decimal encoding specified in 8.5.7 applies;
8.5.7 When decimal encoding is used (bits 8 to 7 = 00), all the contents octets following the first contents octet form a field, as the term is used in ISO 6093, of a length chosen by the sender, and encoded according to ISO 6093. The choice of ISO 6093 number representation is specified by bits 6 to 1 of the first contents octet as follows:
Bits 6 to 1 Number representation:
ISO 6093 simply describes the floating point string representation. NR1 - no decimal separator, NR2 - decimal separator, NR3 - scientific notation. All of these forms can be parsed with parseDouble. The standard allows you to use a comma as a separator, parseDouble is not locale aware, so ',' can be simply replaced with '.'.