The reason why I mentioned the -B flag was because it allowed you to keep the barcode associated with the corresponding read. If you trim prior to alignment, then you lose the barcode which would defeat the entire purpose.
I am familiar with demultiplexing and read trimming. My question was about a specific task that is related, but completely different.