byte buf[] = new byte [1]; int bytes_read = read(buf, 0, 1);  if (bytes_read == -1) return -1;  return buf[0] & 0xFF;
if (channel == null) throw new SocketException("not connected"); while (true) { try { return channel.getVMChannel().read(); } catch (SocketTimeoutException ste) { throw ste; } catch (InterruptedIOException iioe) {  } }
    public int read() throws IOException    {      byte buf[] = new byte [1];      int bytes_read = read(buf, 0, 1);       if (bytes_read == -1)        return -1;      return buf[0] & 0xFF;    }