Create a new StreamMem using buffer as the stream data.
buffer
Note: The newly created StreamMem will destroy buffer when destroyed.
a ByteArray to use as the stream data
a new StreamMem