# Netp5 send &receive (byte) negative value problem

**URL:** <https://discourse.processing.org/t/netp5-send-receive-byte-negative-value-problem/5942>\
**Category:** Processing for Android\
**Created:** [November 26, 2018, 4:09am UTC](https://discourse.processing.org/t/netp5-send-receive-byte-negative-value-problem/5942 "2018-11-26T04:09:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![demket](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@demket](https://discourse.processing.org/u/demket)\
**Post date:** [November 26, 2018, 4:09am UTC](https://discourse.processing.org/t/netp5-send-receive-byte-negative-value-problem/5942/1 "2018-11-26T04:09:38Z")

</div>

Hello,  
I need to send and receive 1 MB file between android tablet and esp32. I did in java mode with “[processing.net](http://processing.net)” library on windows. “[processing.net](http://processing.net)” doesn’t work android mode, so I decided to use netp5 lib without oscp5. Speed is important. I prefered TCP because of data is critical.

I use loadBytes() command to load file. Some values are bigger than 127. did not pose a problem In java mode with client.write(data). But, netp5 sends three bytes (239,191,189) in stead of one negative value (bigger 127). So too on receive.

Any suggestions? Thanks,

I solved the problem. But It isn’t posible to receive 10("\n") and 13("\r"). Netlistener remove them.

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [November 27, 2018, 5:11am UTC](https://discourse.processing.org/t/netp5-send-receive-byte-negative-value-problem/5942/2 "2018-11-27T05:11:48Z")

</div>

One suggestion is to use [URL encoding](https://en.wikipedia.org/wiki/Percent-encoding). Processing provide encoding and encoding functions. Check [this](https://github.com/processing/processing/blob/master/core%2Fsrc%2Fprocessing%2Fcore%2FPApplet.java#L8107).

Kf
