buffer: support reading files into buffers using file descriptors