Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static byte[] IPStringToBytes(String ipString) {
        String[] strs = ipString.split("[.]");
        byte[] b = new byte[strs.length];
        int index = 0;

        for (String str : strs) {
            b[index++] = (byte) (Integer.parseInt(str));
        }
        return b;
    }
}