Added assertion to check that the stream is open when its methods are called
Added type information to ResourceRepositoryInterface