public static void appendHostAddress(StringBuilder sbuf, InetAddress addr) {
        if (addr == null) {
            throw new IllegalArgumentException("addr must not be null");
        }
        if (!(addr instanceof Inet4Address)) {
            throw new IllegalArgumentException("addr must be an instance of Inet4Address");
        }

        byte[] src = addr.getAddress();

        sbuf.append(src[0] & 0xFF)
            .append('.')
            .append(src[1] & 0xFF)
            .append('.')
            .append(src[2] & 0xFF)
            .append('.')
            .append(src[3] & 0xFF);
    }