code: @Nullable
      static byte[] ipv6ToIpv4Address(Inet6Address address) {
          final byte[] addr = address.getAddress();
          assert addr.length == 16
                  : "the length of " + address.getClass().getSimpleName() + ": " + addr.length;
          // The first 10 bytes should be 0.
          for (int i = 0; i < 10; i++) {
              if (addr[i] != 0x00) {
                  return null;
              }
          }
  
          if (addr[10] == 0x00 && addr[11] == 0x00) {
              if (addr[12] == 0x00 && addr[13] == 0x00 && addr[14] == 0x00 && addr[15] == 0x01) {
                  return localhost;
              }
              return new byte[] { addr[12], addr[13], addr[14], addr[15] };
          }
  
          if (addr[10] == (byte) 0xFF && addr[11] == (byte) 0xFF) {
              return new byte[] { addr[12], addr[13], addr[14], addr[15] };
          }
  
          return null;
      }
docs: Returns IPv4 byte representation of the specified {@link Inet6Address}. {@code null} is returned
  if the specified {@link Inet6Address} is not able to be converted to IPv4.