Returns an Inet4Address, given a byte array representation of the IPv4 address. @param bytes byte array representing an IPv4 address (should be of length 4) @return Inet4Address corresponding to the supplied byte array @throws IllegalArgumentException if a valid Inet4Address
(byte[] bytes)
| 122 | */ |
| 123 | |
| 124 | private static Inet4Address getInet4Address(byte[] bytes) { |
| 125 | Preconditions.checkArgument( |
| 126 | bytes.length == 4, |
| 127 | "Byte array has invalid length for an IPv4 address: %s != 4.", |
| 128 | bytes.length); |
| 129 | |
| 130 | // Given a 4-byte array, this cast should always succeed. |
| 131 | return (Inet4Address) bytesToInetAddress(bytes); |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * Returns the {@link InetAddress} having the given string representation. |
no test coverage detected