private KeyToken(byte[] token, byte[] address, int port) { if (token == null) { throw new NullPointerException("token bytes must not be null"); } else if (address == null) { throw new NullPointerException("address must not be null"); } else if (port < 0 || port > MAX_PORT_NO) { throw new IllegalArgumentException("port must be a 16 bit unsigned int"); } this.token = Arrays.copyOf(token, token.length); this.address = address; this.port = port; this.hash = createHash(); }