Quick is correct, altho I've heard of rifles with barrels as short as 16.1 inches in length. Of course most cautious folks or manufacturers will go with 16 1/4 or 16 1/2inches.
Also some trivia, is that a smoothbore .22 LR for shooting ratshot must have a minimum 18inch barrel, or the ATF will go ape-poop over that! As that smooth-bore allows them to define that particular rimfire model as a "shotgun," which GCA'34 (gun control act of 1934) says a shotgun barrel must be 18inches or longer.
I don't remember if the particular .22 rifle I saw last year was an old Marlin or Mossberg, but it was used for shooting small aerial targets at "close" range.