< prev index next >

src/java.base/share/classes/java/net/Inet6Address.java

Print this page

388         holder6 = new Inet6AddressHolder();
389         try {
390             initif (hostName, addr, null);
391         } catch (UnknownHostException e) {} /* cant happen if ifname is null */
392     }
393 
394     Inet6Address (String hostName, byte addr[], NetworkInterface nif)
395         throws UnknownHostException
396     {
397         holder6 = new Inet6AddressHolder();
398         initif (hostName, addr, nif);
399     }
400 
401     Inet6Address (String hostName, byte addr[], String ifname)
402         throws UnknownHostException
403     {
404         holder6 = new Inet6AddressHolder();
405         initstr (hostName, addr, ifname);
406     }
407 





408     /**
409      * Create an Inet6Address in the exact manner of {@link
410      * InetAddress#getByAddress(String,byte[])} except that the IPv6 scope_id is
411      * set to the value corresponding to the given interface for the address
412      * type specified in {@code addr}. The call will fail with an
413      * UnknownHostException if the given interface does not have a numeric
414      * scope_id assigned for the given address type (e.g. link-local or site-local).
415      * See <a href="Inet6Address.html#scoped">here</a> for a description of IPv6
416      * scoped addresses.
417      *
418      * @param host the specified host
419      * @param addr the raw IP address in network byte order
420      * @param nif an interface this address must be associated with.
421      * @return  an Inet6Address object created from the raw IP address.
422      * @throws  UnknownHostException
423      *          if IP address is of illegal length, or if the interface does not
424      *          have a numeric scope_id assigned for the given address type.
425      *
426      * @since 1.5
427      */

388         holder6 = new Inet6AddressHolder();
389         try {
390             initif (hostName, addr, null);
391         } catch (UnknownHostException e) {} /* cant happen if ifname is null */
392     }
393 
394     Inet6Address (String hostName, byte addr[], NetworkInterface nif)
395         throws UnknownHostException
396     {
397         holder6 = new Inet6AddressHolder();
398         initif (hostName, addr, nif);
399     }
400 
401     Inet6Address (String hostName, byte addr[], String ifname)
402         throws UnknownHostException
403     {
404         holder6 = new Inet6AddressHolder();
405         initstr (hostName, addr, ifname);
406     }
407 
408     // use with care
409     Inet6Address (byte[] addr, int scope_id) {
410         holder6 = new Inet6AddressHolder(addr, scope_id, true, null, false);
411     }
412 
413     /**
414      * Create an Inet6Address in the exact manner of {@link
415      * InetAddress#getByAddress(String,byte[])} except that the IPv6 scope_id is
416      * set to the value corresponding to the given interface for the address
417      * type specified in {@code addr}. The call will fail with an
418      * UnknownHostException if the given interface does not have a numeric
419      * scope_id assigned for the given address type (e.g. link-local or site-local).
420      * See <a href="Inet6Address.html#scoped">here</a> for a description of IPv6
421      * scoped addresses.
422      *
423      * @param host the specified host
424      * @param addr the raw IP address in network byte order
425      * @param nif an interface this address must be associated with.
426      * @return  an Inet6Address object created from the raw IP address.
427      * @throws  UnknownHostException
428      *          if IP address is of illegal length, or if the interface does not
429      *          have a numeric scope_id assigned for the given address type.
430      *
431      * @since 1.5
432      */
< prev index next >