Sdílet prostřednictvím


IpPrefix(InetAddress, Int32) Constructor

Definition

Constructs a new IpPrefix from an IPv4 or IPv6 address and a prefix length.

[Android.Runtime.Register(".ctor", "(Ljava/net/InetAddress;I)V", "", ApiSince=33)]
public IpPrefix (Java.Net.InetAddress address, int prefixLength);
[<Android.Runtime.Register(".ctor", "(Ljava/net/InetAddress;I)V", "", ApiSince=33)>]
new Android.Net.IpPrefix : Java.Net.InetAddress * int -> Android.Net.IpPrefix

Parameters

address
InetAddress

the IP address. Must be non-null.

prefixLength
Int32

the prefix length. Must be &gt;= 0 and &lt;= (32 or 128) (IPv4 or IPv6).

Attributes

Remarks

Constructs a new IpPrefix from an IPv4 or IPv6 address and a prefix length. Silently truncates the address to the prefix length, so for example 192.0.2.1/24 is silently converted to 192.0.2.0/24.

Java documentation for android.net.IpPrefix.IpPrefix(java.net.InetAddress, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to