The method should return positive values in the range 0…255 in the case of success and -1 for errors. However, as bytes are always signed in Java, the statement
return single[0];
(line 85 in UDTInputStream.java) may also return negative values and, in particular, returns -1 when the byte 0xFF is received. As a result, standard Java classes like DataInputStream throw EOFExceptions when used with an UDTInputStream. I could solve this problem by replacing the line with
return ((int) single[0]) & 0xff;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The method should return positive values in the range 0…255 in the case of success and -1 for errors. However, as bytes are always signed in Java, the statement
(line 85 in UDTInputStream.java) may also return negative values and, in particular, returns -1 when the byte 0xFF is received. As a result, standard Java classes like DataInputStream throw EOFExceptions when used with an UDTInputStream. I could solve this problem by replacing the line with
thanks, the fix is commited
Bernd.
… and sorry for the horribly late reaction :-(