Couldn't we pass a buffer and a size here?