PHP Unpacking Functionality in Java

I am wondering what is the algorithm underlying the method unpack()in PHP? Maybe there is an equivalent in Java that I could use?

What would be the best way to implement the PHP unpack()method in Java?

+3
source share
2 answers

The closest functionality is the DataInputStream / DataOutputStream data pair.

+2
source

I find the closest in java to Object Serialization.

See java.io.ObjectOutputStreamandjava.io.ObjectInputStream

as always, there is a library method for wrapping this material in several pleasant, convenient ways.

in commons-lang :

php java-.

+1

Source: https://habr.com/ru/post/1761896/


All Articles