开发者

PHP's unpack method functionality in Java

I am wondering what the algorithm behind unpack() method in PHP is? Is there maybe an equivalent in Java which I could use?

开发者_开发问答What would be the best way to implement PHP unpack() method in Java?


The nearest functionality is the DataInputStream/DataOutputStream pair.


I believe the closest in java in Object Serialisation.

See java.io.ObjectOutputStream and java.io.ObjectInputStream

as always there is a library method to wrap this stuff up a couple of nice convenient methods

in commons-lang:

  • SerializationUtils.serialize(Serializable);
  • SerializationUtils.deserialize(byte[]);

But this isn't going to help you with php to java interop.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜