Seeing as how slots inside a bag are just other item slots (251 through 260
according to the Wiki), I assume this is done client side, just like the bank (it is moving items from 1 slot to another).
Is there something in particular you're trying to do with it?