Here you can find the source of toByteArrayV4(String address)
Parameter | Description |
---|---|
address | a parameter |
private static byte[] toByteArrayV4(String address)
//package com.java2s; public class Main { /**//from w w w . j ava2s. c o m * @param address * @return value */ private static byte[] toByteArrayV4(String address) { String[] tokens = address.split("\\."); byte[] value = new byte[4]; for (int index = 0; index < 4; index++) { value[index] = (byte) Integer.parseInt(tokens[index]); } return value; } }