Converts an ArrayBuffer or ArrayBuffer-like object to a string using UTF-16 code units.
Parameters
buf: ArrayBufferLike
The ArrayBuffer or ArrayBuffer-like object to convert.
Returns string
The resulting string representation of the buffer.
Remarks
This function interprets each byte in the buffer as a single UTF-16 code unit.
For multi-byte encoded strings (e.g., UTF-8), consider using a TextDecoder instead.
Converts an ArrayBuffer or ArrayBuffer-like object to a string using UTF-16 code units.