Java Convert via ByteBuffer toInt(InetAddress address)

Here you can find the source of toInt(InetAddress address)

Description

Converts ipv4 InetAddress to Integer.

License

Apache License

Parameter

Parameter Description
address a parameter

Declaration

public static int toInt(InetAddress address) 

Method Source Code


//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();
    }
}

Related

  1. toHexString(Number n)
  2. toInt(byte[] bytes)
  3. toInt(byte[] data)
  4. toInt(byte[] value)
  5. toInt(final byte lowOrderByte, final byte highOrderByte)
  6. toIntArray(byte[] byteArray)
  7. toIntArray(byte[] byteArray)
  8. toIntArray(final byte[] byteArray)
  9. toIntArray(float[] floatArray)