yunbiaolin / android-gl

Automatically exported from code.google.com/p/android-gl
0 stars 0 forks source link

LittleEndianInputStream bug / if (b1 < 0) #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

Many time on class LittleEndianInputStream we can show this check :

int b1 = is.read();
if (b1 < 0)
   b1 += 256;

But java.io.InputStream.read() return an int between 0 to 255 !

byte b = (byte) is.read(); => return an byte between  -127 .. 128

  BUT

int b = is.read(); => return an byte between  0 .. 256

Original issue reported on code.google.com by yyv...@gmail.com on 25 May 2009 at 8:26