public static InetAddress ntoa ( final int address ) { try { final byte [ ] addr = new byte [ 4 ] ; addr [ 0 ] = ( byte ) ( ( address >>> 24 ) & 0xFF ) ; addr [ 1 ] = ( byte ) ( ( address >>> 16 ) & 0xFF ) ; addr [ 2 ] = ( byte ) ( ( address >>> 8 ) & 0xFF ) ; addr [ 3 ] = ( byte ) ( address & 0xFF ) ; return InetAddress . getByAddress ( addr ) ; } catch ( UnknownHostException e ) { // will never be thrown throw new Error ( e ) ; } }
Converts numeric address to an InetAddress