Add support for user-allocated buffers from the C++ API.

Bug: 7256604
Change-Id: Ia5d458ebadfd893e41130f90a1650258280a41cd
3 files changed