I have a byte buffer 6 bytes long, the first four contains the ip address, the last 2 contains the port, in notes with large ends.
to get the ip that I use
(apply str (interleave (map int (take 4 peer)) (repeat ".")))
Does the byte set int int to get the IP address?
as well as in java i,
int port = 0;
port |= peerList[i+4] & 0xFF;
port <<= 8;
port |= peerList[i+5] & 0xFF;
this snippet to get the port address. How can I convert this to clojure?
source
share