Optofluidic multiplexing and switching device