0
I wonder if there is any function in Java equivalent to function pack("v",numero)
of Perl and PHP.
In perl/php:
pack("v",numero) = unsigned short (always 16 bit, little endian byte order)
In Java:
?
0
I wonder if there is any function in Java equivalent to function pack("v",numero)
of Perl and PHP.
In perl/php:
pack("v",numero) = unsigned short (always 16 bit, little endian byte order)
In Java:
?
Browser other questions tagged php java perl
You are not signed in. Login or sign up in order to post.
This http://www.tutorialspoint.com/perl/perl_pack.htm ?
– Edgar Muniz Berlinck
Yes, I wanted to know how I can generate the equivalent result in java.
– Luciano S.
Dude, in Java the guy
short
is Signed orderly big endian, Java 8 started to have some type support unsigned (through methods in Wrappers asInteger
andLong
). How would you like to store your converted number? What are you going to use it for? Guava has a Littleendiandataoutputstream able to writeshorts
for astream
little endian if that’s what you need.– Anthony Accioly
Sockets. Thanks, solved the problem.
– Luciano S.