There's a great trick for this (I'm claiming it will necessarily perform better):

```
return new Scanner(file).useDelimiter("\\A").next();
```