code: public String getName() throws IOException {
          if (name != null)
              return name;
  
          if (isIPv4) {
              //IPv4 address or subdomain
              byte[] host = new byte[4];
              System.arraycopy(address, 0, host, 0, 4);
              name = InetAddress.getByAddress(host).getHostAddress();
              if (address.length == 8) {
                  byte[] mask = new byte[4];
                  System.arraycopy(address, 4, mask, 0, 4);
                  name = name + "/" +
                         InetAddress.getByAddress(mask).getHostAddress();
              }
          } else {
              //IPv6 address or subdomain
              byte[] host = new byte[16];
              System.arraycopy(address, 0, host, 0, 16);
              name = InetAddress.getByAddress(host).getHostAddress();
              if (address.length == 32) {
                  // IPv6 subdomain: display prefix length
  
                  // copy subdomain into new array and convert to BitArray
                  byte[] maskBytes = new byte[16];
                  for (int i=16; i < 32; i++)
                      maskBytes[i-16] = address[i];
                  BitArray ba = new BitArray(16*8, maskBytes);
                  // Find first zero bit
                  int i=0;
                  for (; i < 16*8; i++) {
                      if (!ba.get(i))
                          break;
                  }
                  name = name + "/" + i;
                  // Verify remaining bits 0
                  for (; i < 16*8; i++) {
                      if (ba.get(i)) {
                          throw new IOException("Invalid IPv6 subdomain - set " +
                              "bit " + i + " not contiguous");
                      }
                  }
              }
          }
          return name;
      }
docs: Return a standard String representation of IPAddress.
  See IPAddressName(String) for the formats used for IPv4
  and IPv6 addresses.
  
  @throws IOException if the IPAddress cannot be converted to a String