Implement read() method that reads for a certain size.