Java Long to IP Address long2Ip(final long ip)

Here you can find the source of long2Ip(final long ip)

Description

long Ip

License

Apache License

Declaration

public static String long2Ip(final long ip) 

Method Source Code

//package com.java2s;
// Licensed to the Apache Software Foundation (ASF) under one

public class Main {
    public static String long2Ip(final long ip) {
        final StringBuilder result = new StringBuilder(15);
        result.append(ip >> 24 & 0xff).append(".");
        result.append(ip >> 16 & 0xff).append(".");
        result.append(ip >> 8 & 0xff).append(".");
        result.append(ip & 0xff);/*from   w ww . j av a  2  s . c  om*/

        return result.toString();
    }
}

Related

  1. long2ip(long address)
  2. long2ip(long ip)
  3. long2ip(long ip)
  4. long2ip(long ip)