The surface of a rock in a flowing stream will

The surface of a rock in a flowing stream will often contain a biofilm. What advantages could be conferred on bacteria growing in a biofilm compared with growth within the flowing stream?