Code example for AtomicReference

0
    } 
 
    public SetClientId(byte[] pktdata)
    { 
        super(pktdata);
        this.clientId = new AtomicReference<>();
        int pOff = 0;
        parseString(pOff, clientId);
    } 
 
    public String getClientId()
    { 
        return clientId.get();
    } 
 
    @Override 
    public byte[] toByteArray() 
    { 
        return concatByteArrays(getHeader(), clientId.get().getBytes());
    }