int ret = (int) buf[0]; if (ret < 0) { ret += 0x100; } return ret;
return 0xff & buf[0];
  public int read()    throws IOException  {    byte[] buf = new byte[1];    int len = read(buf, 0, 1);    if (len == -1)      {        return -1;      }    int ret = (int) buf[0];    if (ret < 0)      {        ret += 0x100;      }    return ret;  }