public ExactIPv6AddressPermission()

in activeio-core/src/main/java/org/apache/activeio/xnet/hba/ExactIPv6AddressPermission.java [43:58]


    public ExactIPv6AddressPermission(String mask) {
        Matcher matcher = MASK_VALIDATOR.matcher(mask);
        if (false == matcher.matches()) {
            throw new IllegalArgumentException("Mask " + mask + " does not match pattern " + MASK_VALIDATOR.pattern());
        }

        bytes = new byte[16];
        int pos = 0;
        StringTokenizer tokenizer = new StringTokenizer(mask, ":");
        while (tokenizer.hasMoreTokens()) {
            String token = tokenizer.nextToken();
            int value = Integer.parseInt(token, 16);
            bytes[pos++] = (byte) ((value & 0xff00) >> 8);
            bytes[pos++] = (byte) value;
        }
    }