making a generic reader
better buffer size and fixing io.Reader bug