开发者

Use String or Object for data in Java NIO-based distributed system? [closed]

开发者 https://www.devze.com 2023-03-06 17:03 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I am trying to send data different data (Security keys, encrypted message )in distributed system that use Java NIO. my 开发者_JAVA技巧question is what is the best way to send data? . I am currently sending data using base64 encoding and append different data in to a single string. Is this good or it will be good to send data using java serializable object.

please help Thanx


I would probably avoid using Strings and Java default serialization - that's likely to be pretty inefficient and give you a lot of overhead.

I'd recommend looking at a library like Kryonet or Netty instead.

Alternatively you can create your own serialisation code using NIO, but that's quite complex to get right and a lot of work....

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号