public boolean bytesAvailable(final int expectedBytes){
  int bytesLeft=byteStream.available();
  return bytesLeft >= expectedBytes;
}

public boolean bytesAvailable ( final int expectedBytes ) { int bytesLeft = byteStream . available ( ) ; return bytesLeft >= expectedBytes ; }
checks whether a given number of bytes can be read .
