< prev index next >

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

Print this page




 159  * that identifies the particular interface and scope as understood by the
 160  * system. Usually, the numeric values can be determined through administration
 161  * tools on the system. Each interface may have multiple values, one for each
 162  * scope. If the scope is unspecified, then the default value used is zero.</li>
 163  * <li><i>As a string.</i> This must be the exact string that is returned by
 164  * {@link java.net.NetworkInterface#getName()} for the particular interface in
 165  * question. When an Inet6Address is created in this way, the numeric scope-id
 166  * is determined at the time the object is created by querying the relevant
 167  * NetworkInterface.</li></ol>
 168  *
 169  * <p> Note also, that the numeric <i>scope_id</i> can be retrieved from
 170  * Inet6Address instances returned from the NetworkInterface class. This can be
 171  * used to find out the current scope ids configured on the system.
 172  * @since 1.4
 173  */
 174 
 175 public final
 176 class Inet6Address extends InetAddress {
 177     static final int INADDRSZ = 16;
 178 





 179     private class Inet6AddressHolder {
 180 
 181         private Inet6AddressHolder() {
 182             ipaddress = new byte[INADDRSZ];
 183         }
 184 
 185         private Inet6AddressHolder(
 186             byte[] ipaddress, int scope_id, boolean scope_id_set,
 187             NetworkInterface ifname, boolean scope_ifname_set)
 188         {
 189             this.ipaddress = ipaddress;
 190             this.scope_id = scope_id;
 191             this.scope_id_set = scope_id_set;
 192             this.scope_ifname_set = scope_ifname_set;
 193             this.scope_ifname = ifname;
 194         }
 195 
 196         /**
 197          * Holds a 128-bit (16 bytes) IPv6 address.
 198          */




 159  * that identifies the particular interface and scope as understood by the
 160  * system. Usually, the numeric values can be determined through administration
 161  * tools on the system. Each interface may have multiple values, one for each
 162  * scope. If the scope is unspecified, then the default value used is zero.</li>
 163  * <li><i>As a string.</i> This must be the exact string that is returned by
 164  * {@link java.net.NetworkInterface#getName()} for the particular interface in
 165  * question. When an Inet6Address is created in this way, the numeric scope-id
 166  * is determined at the time the object is created by querying the relevant
 167  * NetworkInterface.</li></ol>
 168  *
 169  * <p> Note also, that the numeric <i>scope_id</i> can be retrieved from
 170  * Inet6Address instances returned from the NetworkInterface class. This can be
 171  * used to find out the current scope ids configured on the system.
 172  * @since 1.4
 173  */
 174 
 175 public final
 176 class Inet6Address extends InetAddress {
 177     static final int INADDRSZ = 16;
 178 
 179     /*
 180      * cached scope_id - for link-local address use only.
 181      */
 182     private transient int cached_scope_id;  // 0
 183 
 184     private class Inet6AddressHolder {
 185 
 186         private Inet6AddressHolder() {
 187             ipaddress = new byte[INADDRSZ];
 188         }
 189 
 190         private Inet6AddressHolder(
 191             byte[] ipaddress, int scope_id, boolean scope_id_set,
 192             NetworkInterface ifname, boolean scope_ifname_set)
 193         {
 194             this.ipaddress = ipaddress;
 195             this.scope_id = scope_id;
 196             this.scope_id_set = scope_id_set;
 197             this.scope_ifname_set = scope_ifname_set;
 198             this.scope_ifname = ifname;
 199         }
 200 
 201         /**
 202          * Holds a 128-bit (16 bytes) IPv6 address.
 203          */


< prev index next >