public void encodeInline(final RLPOutput out) {
    if (host.isPresent()) {
      InetAddress hostAddress = InetAddresses.forString(host.get());
      if (hostAddress != null) {
        out.writeInetAddress(hostAddress);
      } else { // present, but not a parseable IP address
        out.writeNull();
      }
    } else {
      out.writeNull();
    }
    out.writeIntScalar(udpPort);
    tcpPort.ifPresentOrElse(out::writeIntScalar, out::writeNull);
  }
Encodes this endpoint to an RLP representation that is inlined into a containing object
(generally a Peer).

@param out The RLP output stream.
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/Endpoint.java