No, the arduino loops faster than the serial input buffer is fulled, and may see the buffer as empty on some loops.
This is also wrong.
Serial.available returns -1 when the receive buffer is empty (not zero). So given the OP's code, he will never escape past the while loop.