Support returning buffers and streams