readAll, writeAll should throw exception if error