> On 16 Jan 2020, at 12:11, HilaireFernandes <[hidden email]> wrote:
> Thanks Sven, it works.
> If understood correctly ByteArray on streaming only accept ByteArray.
> I wonder, should the string be terminated by a null byte, as exepcted on C?
That dependents on your protocol's definition/spec.
It is easy to add a null byte,
stream nextPut: 0
In some protocols, strings are encoded with a byte length prefix.