refactored `read` to accept `out`

readinto can thus be turned into a private method