android/guava/src/com/google/common/net/InetAddresses.java
private static Inet4Address getInet4Address(byte[] bytes) {
    checkArgument(
        bytes.length == 4,
        "Byte array has invalid length for an IPv4 address: %s != 4.",
        bytes.length);

    // Given a 4-byte array, this cast should always succeed.
    return (Inet4Address) bytesToInetAddress(bytes);
  }
private static Inet4Address getInet4Address(byte[] bytes) {
    checkArgument(
        bytes.length == 4,
        "Byte array has invalid length for an IPv4 address: %s != 4.",
        bytes.length);

    // Given a 4-byte array, this cast should always succeed.
    return (Inet4Address) bytesToInetAddress(bytes);
  }
Returns an {@link Inet4Address}, given a byte array representation of the IPv4 address.

@param bytes byte array representing an IPv4 address (should be of length 4)
@return {@link Inet4Address} corresponding to the supplied byte array
@throws IllegalArgumentException if a valid {@link Inet4Address} can not be created