synchronized public int read() throws IOException {
  if (buf.remaining() == 0) {
    return -1;
  }
  final byte b=buf.get();
  return (0xff & b);
}

synchronized public int read ( ) throws IOException { if ( buf . remaining ( ) == 0 ) { return - 1 ; } final byte b = buf . get ( ) ; return ( 0xff & b ) ; }
read the next byte from the buffer .
