Read blocks from input and add them to buffer