Please advise me about calculating length

Dear all,

I am converting a file which is encoded as ASN.1/BER. While I converting that file almost of it goes fine. But some record length is more than 256 is confusing problem. Java byte is not unsigned, so its values are -127...0 ... 127. I can calculate length that is lower than 256.

How can I calculate length that is more than 256.

Thank you,

[376 byte] By [Bat_a] at [2007-10-2 18:26:24]
# 1
I am guessing but usingint length = byteData[indexOfLengthField] & 0xff;will allow you to define a record length of up to 255.
sabre150a at 2007-7-13 19:47:31 > top of Java-index,Other Topics,Algorithms...