Here you can find the source of convertLongAddressToBuf(long ipAddress)
private static byte[] convertLongAddressToBuf(long ipAddress)
//package com.java2s; //License from project: Apache License public class Main { private static byte[] convertLongAddressToBuf(long ipAddress) { byte[] result = new byte[4]; result[0] = (byte) ((ipAddress >> 24) & 0xFF); result[1] = (byte) ((ipAddress >> 16) & 0xFF); result[2] = (byte) ((ipAddress >> 8) & 0xFF); result[3] = (byte) ((ipAddress >> 0) & 0xFF); return result; }/* w w w . j a v a 2 s. c om*/ }