(int address)
| 52 | |
| 53 | |
| 54 | public IP4Address(int address) throws UnknownHostException{ |
| 55 | mByteArray = new byte[4]; |
| 56 | mInteger = address; |
| 57 | |
| 58 | if(ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN){ |
| 59 | mByteArray[0] = (byte) (address & 0xFF); |
| 60 | mByteArray[1] = (byte) (0xFF & address >> 8); |
| 61 | mByteArray[2] = (byte) (0xFF & address >> 16); |
| 62 | mByteArray[3] = (byte) (0xFF & address >> 24); |
| 63 | } else{ |
| 64 | mByteArray[0] = (byte) (0xFF & address >> 24); |
| 65 | mByteArray[1] = (byte) (0xFF & address >> 16); |
| 66 | mByteArray[2] = (byte) (0xFF & address >> 8); |
| 67 | mByteArray[3] = (byte) (address & 0xFF); |
| 68 | } |
| 69 | |
| 70 | mAddress = InetAddress.getByAddress(mByteArray); |
| 71 | mString = mAddress.getHostAddress(); |
| 72 | } |
| 73 | |
| 74 | public IP4Address(String address) throws UnknownHostException{ |
| 75 | mString = address; |
nothing calls this directly
no test coverage detected