Layer-by-layer assembly in nanochannels: assembly mechanism and applications.