ot::MutableData::CopyBytesFrom() method
Copies the bytes from a given buffer into the `MutableData` buffer. If the current `MutableData` length is larger than or equal to @p aLength, then all the bytes are copied from @p aBuffer into the buffer of `MutableData` and the `MutableData`'s length is changed to @p aLength. If the current `MutableData` length is smaller than @p aLength, then the method returns `kErrorNoBufs` but still copies as many bytes as can fit.
Arguments
aBuffer
A pointer to a buffer to copy from.
aLength
The length of @p aBuffer (number of bytes).
Return value
kErrorNone Successfully copied the bytes into `MutableData` buffer and adjusted its length. kErrorNoBufs `MutableData` buffer cannot fit the given @p aLength bytes.