Adds support for initializing with new buffer instead of file