code: static Inet4Address getInet4Address(byte[] bytes) {
          if (bytes.length != 4)
              throw new IllegalArgumentException(format("Byte array has invalid length for an IPv4 address: %s != 4.", bytes.length));
  
          try {
              // Given a 4-byte array, this cast should always succeed.
              return (Inet4Address) InetAddress.getByAddress(bytes);
          } catch (UnknownHostException e) {
              throw new AssertionError(e);
          }
      }
docs: 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