# Writing to network stream

**URL:** <https://discourse.nodered.org/t/writing-to-network-stream/73913>\
**Category:** General\
**Created:** [19 January 2023 13:59 UTC](https://discourse.nodered.org/t/writing-to-network-stream/73913 "2023-01-19T13:59:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruceb85](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@bruceb85](https://discourse.nodered.org/u/bruceb85)\
**Post date:** [19 January 2023 13:59 UTC](https://discourse.nodered.org/t/writing-to-network-stream/73913/1 "2023-01-19T13:59:28Z")

</div>

When using the tcp nodes, does node red convert ascii text to bytes before writing them to the stream? Or do I need to convert the string to a byte buffer before sending the payload ?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [19 January 2023 14:23 UTC](https://discourse.nodered.org/t/writing-to-network-stream/73913/2 "2023-01-19T14:23:48Z")

</div>

It is all the same - they are all bytes down the wire.

Typically sending strings is fine but if you need to be 100% sure, send a `Buffer` object.

* * *

PS, very easy to test - add a pair of TCP-in - TCP out nodes and test it for yourself 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 March 2023 14:24 UTC](https://discourse.nodered.org/t/writing-to-network-stream/73913/3 "2023-03-20T14:24:21Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
