/core/reader - refactor to support input and output sources, buffering internally if no specific external source was specified