/** * Create IPv6 address from a string comma separated, where each field is 2 bytes. * 1080:0:0:0:8:800:200C:417A * * @param theIpAddr */ public IPv6Address(String theIpAddr) { String fields[] = theIpAddr.split("\\:"); myIPv6Addr = new byte[IPV6_SIZE]; for (int i = 0; i < fields.length; i++) { int n = Integer.parseInt(fields[i], 16); ByteUtils.setLittleIndianInBytesArray(myIPv6Addr, IPV6_SIZE - i * 2 - 2, n, 2); } }
/** @return the ipv6 as big endian */ public byte[] getIpv6BigEndianByteaArray() { if (_isBigEndian) { return getIPv6AddressByteArray(); } return ByteUtils.cobvertLittleToBig(myIPv6Addr); }