public class IPConvert extends Object
| Constructor | Description |
|---|---|
IPConvert() |
| Modifier and Type | Method | Description |
|---|---|---|
static byte[] |
longToBytes(long ip) |
Convert the long ip address to byte array ip address.
|
static int |
longToBytes(long ip,
byte[] result,
int index) |
Append the byte array representation of given long ip address into the given byte array.
|
static String |
longToIp(long ip) |
Convert the long ip address to String ip address.
|
static String |
longToString(long ip) |
Convert the long ip address to String ip address.
|
static long |
stringToLong(String ip) |
Convert the string ip address to String ip address.
|
public static String longToIp(long ip)
ip - ip address in long which should be converted.public static byte[] longToBytes(long ip)
ip - ip address in long which should be converted.public static int longToBytes(long ip,
byte[] result,
int index)
ip - ip address in long which should be converted.result - converted ip address will be appended into this byte array.index - starting index of the byte array where ip address should be appended.public static long stringToLong(String ip)
ip - ip address in String which should be converted.public static String longToString(long ip)
ip - ip address in long which should be converted.Copyright © 2025. All rights reserved.