format int value Ip Address - Android Network

Android examples for Network:IP Address

Description

format int value Ip Address

Demo Code


//package com.java2s;

public class Main {
    private static String formatIpAddress(int ipAdress) {
        return (ipAdress & 0xFF) + "." + ((ipAdress >> 8) & 0xFF) + "."
                + ((ipAdress >> 16) & 0xFF) + "." + (ipAdress >> 24 & 0xFF);
    }/*from  w w  w . j a  va2s  .  co m*/
}

Related Tutorials