< prev index next >

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

Print this page




  24  */
  25 
  26 package java.net;
  27 
  28 import java.io.ObjectStreamException;
  29 
  30 /**
  31  * This class represents an Internet Protocol version 4 (IPv4) address.
  32  * Defined by <a href="http://www.ietf.org/rfc/rfc790.txt">
  33  * <i>RFC&nbsp;790: Assigned Numbers</i></a>,
  34  * <a href="http://www.ietf.org/rfc/rfc1918.txt">
  35  * <i>RFC&nbsp;1918: Address Allocation for Private Internets</i></a>,
  36  * and <a href="http://www.ietf.org/rfc/rfc2365.txt"><i>RFC&nbsp;2365:
  37  * Administratively Scoped IP Multicast</i></a>
  38  *
  39  * <h3> <a id="format">Textual representation of IP addresses</a> </h3>
  40  *
  41  * Textual representation of IPv4 address used as input to methods
  42  * takes one of the following forms:
  43  *
  44  * <blockquote><table cellpadding=0 cellspacing=0 summary="layout">
  45  * <tr><td>{@code d.d.d.d}</td></tr>
  46  * <tr><td>{@code d.d.d}</td></tr>
  47  * <tr><td>{@code d.d}</td></tr>
  48  * <tr><td>{@code d}</td></tr>
  49  * </table></blockquote>
  50  *
  51  * <p> When four parts are specified, each is interpreted as a byte of
  52  * data and assigned, from left to right, to the four bytes of an IPv4
  53  * address.
  54 
  55  * <p> When a three part address is specified, the last part is
  56  * interpreted as a 16-bit quantity and placed in the right most two
  57  * bytes of the network address. This makes the three part address
  58  * format convenient for specifying Class B net- work addresses as
  59  * 128.net.host.
  60  *
  61  * <p> When a two part address is supplied, the last part is
  62  * interpreted as a 24-bit quantity and placed in the right most three
  63  * bytes of the network address. This makes the two part address
  64  * format convenient for specifying Class A network addresses as
  65  * net.host.
  66  *
  67  * <p> When only one part is given, the value is stored directly in
  68  * the network address without any byte rearrangement.
  69  *




  24  */
  25 
  26 package java.net;
  27 
  28 import java.io.ObjectStreamException;
  29 
  30 /**
  31  * This class represents an Internet Protocol version 4 (IPv4) address.
  32  * Defined by <a href="http://www.ietf.org/rfc/rfc790.txt">
  33  * <i>RFC&nbsp;790: Assigned Numbers</i></a>,
  34  * <a href="http://www.ietf.org/rfc/rfc1918.txt">
  35  * <i>RFC&nbsp;1918: Address Allocation for Private Internets</i></a>,
  36  * and <a href="http://www.ietf.org/rfc/rfc2365.txt"><i>RFC&nbsp;2365:
  37  * Administratively Scoped IP Multicast</i></a>
  38  *
  39  * <h3> <a id="format">Textual representation of IP addresses</a> </h3>
  40  *
  41  * Textual representation of IPv4 address used as input to methods
  42  * takes one of the following forms:
  43  *
  44  * <blockquote><ul style="list-style-type:none">
  45  * <li>{@code d.d.d.d}</li>
  46  * <li>{@code d.d.d}</li>
  47  * <li>{@code d.d}</li>
  48  * <li>{@code d}</li>
  49  * </ul></blockquote>
  50  *
  51  * <p> When four parts are specified, each is interpreted as a byte of
  52  * data and assigned, from left to right, to the four bytes of an IPv4
  53  * address.
  54 
  55  * <p> When a three part address is specified, the last part is
  56  * interpreted as a 16-bit quantity and placed in the right most two
  57  * bytes of the network address. This makes the three part address
  58  * format convenient for specifying Class B net- work addresses as
  59  * 128.net.host.
  60  *
  61  * <p> When a two part address is supplied, the last part is
  62  * interpreted as a 24-bit quantity and placed in the right most three
  63  * bytes of the network address. This makes the two part address
  64  * format convenient for specifying Class A network addresses as
  65  * net.host.
  66  *
  67  * <p> When only one part is given, the value is stored directly in
  68  * the network address without any byte rearrangement.
  69  *


< prev index next >