[英]Java Creating a packet byte array to send to server
How would one go about making a byte[] that is a packet that needs to be run through an RC4 encryption class and then sent to a server? 如何制作一个byte [],它是一个需要通过RC4加密类运行然后发送到服务器的数据包?
So let's say I need the packet to stsrt with a string, followed with an int, byte, int, string. 因此,假设我需要使用字符串将数据包发送到stsrt,然后是int,byte,int,string。 How would I create that as a byte array?
如何将其创建为字节数组? (Byte[])
(字节[])
Thanks! 谢谢!
OK, so you have a data structure containing strings, integers and bytes, that you want to serialize to a byte array. 好的,所以您有一个包含字符串,整数和字节的数据结构,您想要序列化为字节数组。 There are several options:
有几种选择:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.