9 Replies Latest reply on May 12, 2010 10:42 AM by EJP

    Problem when reading binary data to ByteBuffer

      I'm trying to parse a dbf file. Usually it works fine, but for some files the first byte is not read properly. My code:
                FileChannel dbfFile=new FileInputStream(dbfFileName).getChannel();
                int count=dbfFile.read(buffer);
                // read-in basic table definition
      sometimes sets -125 to dbfType, but when I view the file with hex viewer the value is 83. How is it possible that the received value is negative? Is it my problem or java stream reading problem (feature?)?