Conversion between int and byte [] in Java

In previous projects, the value of int type needs to be passed during socket communication. However, it seems that the outputsteam in Java can not directly pass int type, only byte [], so here is the method of converting int and byte [].

Just turn it around when you receive it

The above is the mutual conversion of int and byte [] in Java introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>