Hi,
I am having difficulty reading binary data using the DataInputStream class. The problem is that the high byte characters (>= ascii 128) are being read as signed numbers when I use the myDIS.readFully() method where as I want to read these as the characters corresponding to their (>=128) ascii code.
I could this by going into a loop for the length of the data and then use myDIS.readUnsignedByte() method to read each character out of the stream one by one but obviously it is not a very efficient way and it takes longer to read the file when the file is long.
I was wondering if there is an easier and efficient way of doing the same?
Is their any way to convert signed byte to unsigned byte? (I can get the character once I have the unsigned byte)
Thanks for any help. RM
=============================
Complete solution for digital photos (FREE) @
I am having difficulty reading binary data using the DataInputStream class. The problem is that the high byte characters (>= ascii 128) are being read as signed numbers when I use the myDIS.readFully() method where as I want to read these as the characters corresponding to their (>=128) ascii code.
I could this by going into a loop for the length of the data and then use myDIS.readUnsignedByte() method to read each character out of the stream one by one but obviously it is not a very efficient way and it takes longer to read the file when the file is long.
I was wondering if there is an easier and efficient way of doing the same?
Is their any way to convert signed byte to unsigned byte? (I can get the character once I have the unsigned byte)
Thanks for any help. RM
=============================
Complete solution for digital photos (FREE) @