Question about .available()

It depends on whether you are using hardware or software serial. In software serial, it clears the input buffer, as shown earlier. In hardware serial, it depends on which version of the IDE you have. From IDE 1.0 onward, it blocks until the output buffer is empty, this is because hardware serial output became interrupt driven, so serial output calls no longer block. Prior to IDE 1.0, it cleared the input buffer.