public int available() throws IOException {
  int bytesAvailable=in.available();
  if (bytesAvailable > bytesLeft)   bytesAvailable=bytesLeft;
  return bytesAvailable;
}

public int available ( ) throws IOException { int bytesAvailable = in . available ( ) ; if ( bytesAvailable > bytesLeft ) bytesAvailable = bytesLeft ; return bytesAvailable ; }
returns the number of bytes that can be read with blocking . make sure that this does not exceed the number of bytes remaining in the proper content of the message .
