Here you can find the source of toInt(InetAddress address)
Parameter | Description |
---|---|
address | a parameter |
public static int toInt(InetAddress address)
//package com.java2s; //License from project: Apache License import java.net.InetAddress; import java.nio.ByteBuffer; public class Main { /**/* w w w . j a va 2 s . c o m*/ * Converts ipv4 InetAddress to Integer. * * @param address * @return */ public static int toInt(InetAddress address) { return ByteBuffer.wrap(address.getAddress()).getInt(); } }