@Test public void testAddressToOctetsIPv4() { Ip4Address ipAddress; byte[] value; value = new byte[] {1, 2, 3, 4}; ipAddress = Ip4Address.valueOf("1.2.3.4"); assertThat(ipAddress.toOctets(), is(value)); value = new byte[] {0, 0, 0, 0}; ipAddress = Ip4Address.valueOf("0.0.0.0"); assertThat(ipAddress.toOctets(), is(value)); value = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff}; ipAddress = Ip4Address.valueOf("255.255.255.255"); assertThat(ipAddress.toOctets(), is(value)); }
public static Ip4Address valueOf(int value) { byte[] bytes = ByteBuffer.allocate(INET_BYTE_LENGTH).putInt(value).array(); return new Ip4Address(bytes); }
Ip4Address extends IpAddress { public static Ip4Address valueOf(int value) { byte[] bytes = ByteBuffer.allocate(INET_BYTE_LENGTH).putInt(value).array(); return new Ip4Address(bytes); } }
Ip4Address extends IpAddress { public static Ip4Address valueOf(int value) { byte[] bytes = ByteBuffer.allocate(INET_BYTE_LENGTH).putInt(value).array(); return new Ip4Address(bytes); } private  Ip4Address(byte[] value); }
Ip4Address extends IpAddress { public static Ip4Address valueOf(int value) { byte[] bytes = ByteBuffer.allocate(INET_BYTE_LENGTH).putInt(value).array(); return new Ip4Address(bytes); } private  Ip4Address(byte[] value); int toInt(); static Ip4Address valueOf(int value); static Ip4Address valueOf(byte[] value); static Ip4Address valueOf(byte[] value, int offset); static Ip4Address valueOf(InetAddress inetAddress); static Ip4Address valueOf(String value); static Ip4Address makeMaskPrefix(int prefixLength); static Ip4Address makeMaskedAddress(final Ip4Address address,
                                               int prefixLength); }
Ip4Address extends IpAddress { public static Ip4Address valueOf(int value) { byte[] bytes = ByteBuffer.allocate(INET_BYTE_LENGTH).putInt(value).array(); return new Ip4Address(bytes); } private  Ip4Address(byte[] value); int toInt(); static Ip4Address valueOf(int value); static Ip4Address valueOf(byte[] value); static Ip4Address valueOf(byte[] value, int offset); static Ip4Address valueOf(InetAddress inetAddress); static Ip4Address valueOf(String value); static Ip4Address makeMaskPrefix(int prefixLength); static Ip4Address makeMaskedAddress(final Ip4Address address,
                                               int prefixLength); static final IpAddress.Version VERSION; static final int BYTE_LENGTH; static final int BIT_LENGTH; }