Added argument to read from existing buffer