support buffers in addition to file paths