Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {

    public static String int2ipForm(long ipInt) {
        StringBuilder sb = new StringBuilder();
        String s1 = (ipInt & 0xFF) + "";
        String s2 = ((ipInt >> 8) & 0xFF) + "";
        String s3 = ((ipInt >> 16) & 0xFF) + "";
        String s4 = ((ipInt >> 24) & 0xFF) + "";
        sb.append(s4).append(".").append(s3).append(".").append(s2).append(".").append(s1);
        return sb.toString();
    }
}