# Save string into byte array

**URL:** <https://discourse.processing.org/t/save-string-into-byte-array/4371>\
**Category:** Coding Questions\
**Created:** [October 11, 2018, 5:46pm UTC](https://discourse.processing.org/t/save-string-into-byte-array/4371 "2018-10-11T17:46:12Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 14, 2018, 1:03pm UTC](https://discourse.processing.org/t/save-string-into-byte-array/4371/19 "2018-10-14T13:03:33Z")

</div>

- Java’s `byte` datatype got a range from `-128` to `127`: ☕  
[byte / Reference / Processing.org](http://Processing.org/reference/byte.html)
- It can’t store anything higher than `127`, like `128` or `255`! 😱
- However, don’t need to fret so much; b/c when we save or send those negative values as `byte`, they’re properly interpreted back to the original positive values: 🤭

> [@Udp problem sending byte (-127)](https://discourse.processing.org/t/udp-problem-sending-byte-127/3545):
>
> Hello, I am trying to send visca commands over udp. To send a command to camera 1 you have to send byte (0x81). Unfortunately udp.send sends the value 63! I discovered this by sending from processing 3 on windows and I am receiving with processing on a raspberry pi with processing 3 byte[] mist = {byte(80),byte(0x81), byte(0x82), byte(0x83), byte(0x84), byte(0x85), byte(0xFF)}; String massage=new String(mist); udp.send(massage, ip, port); results on the receiver side to -128, 63, -126,-…

---

_[View the full topic](https://discourse.processing.org/t/save-string-into-byte-array/4371)._
