Throw IoException instead of IllegalStateException