Java Long to longToRemoteAddrTo(long remoteAddr)

Here you can find the source of longToRemoteAddrTo(long remoteAddr)

Description

long To Remote Addr To

License

Apache License

Declaration

public static String longToRemoteAddrTo(long remoteAddr) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String longToRemoteAddrTo(long remoteAddr) {
        StringBuilder sb = new StringBuilder();
        for (int i = 24; i >= 0; i -= 8) {
            long l = (remoteAddr >> i) & 0xff;
            if (sb.length() > 0) {
                sb.append(".");
            }/*  ww  w .j a v a  2s  .c o  m*/
            sb.append(l);
        }
        return sb.toString();
    }
}

Related

  1. longToNumberWithDecimalPlaces(long longValue, int decimalPlaces)
  2. LongToOctString(final long value)
  3. longToOther(Object val, Class dest)
  4. longToPrefixCoded(final long val, final int shift, final char[] buffer)
  5. longToRegisters(long v)
  6. longToSortableBytes(long value, byte[] result, int offset)
  7. longToStringAddress(long addr)
  8. longToStringWithZeroFill(long longValue, int width)
  9. longToTimeString(long time)