Depends what is needed, really. If it's actually necessary to cater for arbitrary numbers of bits then it would be better to have a loop that fishes bits one by one out of the source, assembles the value, then writes it into the destination once the right number of bits has been read. But, if there really are only a fixed set of widths then the switch and case is fine (to my eyes anyway), as it is probably clearer what is going on. There's no point making the code more generic than it needs to be.
In either case, it would probably be better to have all of this hidden behind a function, or some other means of abstraction, so that it can be reused more easily ("every time" suggests that this bit of code crops up in several places), and the result of the decision written only in one place.
(A further comment I would make is that if using an enum to represent some fixed set of bit counts each enumerant should have an arbitrary value, rather than the corresponding bit count. This better indicates that the name does not in any way signify an arbitrary bit count, but is rather simply a token indicating one of the supported bit counts.)
(Also when reading 16 bits one of the bytes should probably come from input[j+1]
.)