Example usage for java.net Inet6Address getByAddress

List of usage examples for java.net Inet6Address getByAddress

Introduction

In this page you can find the example usage for java.net Inet6Address getByAddress.

Prototype

public static Inet6Address getByAddress(String host, byte[] addr, int scope_id) throws UnknownHostException 

Source Link

Document

Create an Inet6Address in the exact manner of InetAddress#getByAddress(String,byte[]) except that the IPv6 scope_id is set to the given numeric value.

Usage

From source file:ch.cyberduck.core.socket.NetworkInterfaceAwareSocketFactory.java

/**
 * @param network Network interface index
 * @throws UnknownHostException/*from ww  w.  ja  v  a 2s.co m*/
 */
private Inet6Address getByAddressForInterface(final NetworkInterface network, final InetAddress address)
        throws UnknownHostException {
    // Append network interface. Workaround for issue #8802
    return Inet6Address.getByAddress(address.getHostAddress(),
            IPAddressUtil.textToNumericFormatV6(address.getHostAddress()), network.getIndex());
}