Using stream heap allocation with specified functions in buffers API