/**
  * Read up to desired bytes of data into the internal buffer.
  *
  * @return the number of bytes available, or -1 if the connection is closed.
  */
 public int readAvailable(int desired) {
   int available = read.tryRead(desired);
   return available;
 }