For what it's worth, this can also be written using the ["placeholder form" of `checkState`](http://guava-libraries.googlecode.com/svn-history/r14/trunk/javadoc/com/google/common/base/Preconditions.html#checkState\(boolean, java.lang.String, java.lang.Object...\)) as
```
checkState(bytesWritten == length, "Wrote %s bytes, but we wanted to write %s bytes", bytesWritten, length);
```