src/java.base/share/classes/java/net/Inet6Address.java
changeset 52499 768b1c612100
parent 52220 9c260a6b6471
child 53018 8bf9268df0e2
equal deleted inserted replaced
52498:c3066f7465fa 52499:768b1c612100
   413      * Create an Inet6Address in the exact manner of {@link
   413      * Create an Inet6Address in the exact manner of {@link
   414      * InetAddress#getByAddress(String,byte[])} except that the IPv6 scope_id is
   414      * InetAddress#getByAddress(String,byte[])} except that the IPv6 scope_id is
   415      * set to the value corresponding to the given interface for the address
   415      * set to the value corresponding to the given interface for the address
   416      * type specified in {@code addr}. The call will fail with an
   416      * type specified in {@code addr}. The call will fail with an
   417      * UnknownHostException if the given interface does not have a numeric
   417      * UnknownHostException if the given interface does not have a numeric
   418      * scope_id assigned for the given address type (eg. link-local or site-local).
   418      * scope_id assigned for the given address type (e.g. link-local or site-local).
   419      * See <a href="Inet6Address.html#scoped">here</a> for a description of IPv6
   419      * See <a href="Inet6Address.html#scoped">here</a> for a description of IPv6
   420      * scoped addresses.
   420      * scoped addresses.
   421      *
   421      *
   422      * @param host the specified host
   422      * @param host the specified host
   423      * @param addr the raw IP address in network byte order
   423      * @param addr the raw IP address in network byte order
   505         holder.init(hostName, family);
   505         holder.init(hostName, family);
   506     }
   506     }
   507 
   507 
   508     /* check the two Ipv6 addresses and return false if they are both
   508     /* check the two Ipv6 addresses and return false if they are both
   509      * non global address types, but not the same.
   509      * non global address types, but not the same.
   510      * (ie. one is sitelocal and the other linklocal)
   510      * (i.e. one is site-local and the other link-local)
   511      * return true otherwise.
   511      * return true otherwise.
   512      */
   512      */
   513 
   513 
   514     private static boolean isDifferentLocalAddressType(
   514     private static boolean isDifferentLocalAddressType(
   515         byte[] thisAddr, byte[] otherAddr) {
   515         byte[] thisAddr, byte[] otherAddr) {
   681     }
   681     }
   682 
   682 
   683     /**
   683     /**
   684      * Utility routine to check if the InetAddress is a wildcard address.
   684      * Utility routine to check if the InetAddress is a wildcard address.
   685      *
   685      *
   686      * @return a {@code boolean} indicating if the Inetaddress is
   686      * @return a {@code boolean} indicating if the InetAddress is
   687      *         a wildcard address.
   687      *         a wildcard address.
   688      */
   688      */
   689     @Override
   689     @Override
   690     public boolean isAnyLocalAddress() {
   690     public boolean isAnyLocalAddress() {
   691         return holder6.isAnyLocalAddress();
   691         return holder6.isAnyLocalAddress();
   819         return holder6.scope_id;
   819         return holder6.scope_id;
   820      }
   820      }
   821 
   821 
   822     /**
   822     /**
   823      * Returns the scoped interface, if this instance was created with
   823      * Returns the scoped interface, if this instance was created with
   824      * with a scoped interface.
   824      * a scoped interface.
   825      *
   825      *
   826      * @return the scoped interface, or null if not set.
   826      * @return the scoped interface, or null if not set.
   827      * @since 1.5
   827      * @since 1.5
   828      */
   828      */
   829      public NetworkInterface getScopedInterface() {
   829      public NetworkInterface getScopedInterface() {