I dont know who told you that the name had something to do with the famine but that has to be one of the funniest things I've ever heard.............
Rafter and Raftery are cognate Rafter = O Reachtabhair in Irish (Sometimes as Reachtair in Mod. Irish) Raftery = O Reachtabhra in Irish (Sometimes as Reachtaire in Mod. Irish) and can be traced back to 7-9th century Ireland
The surname Rafter/Raftery is not a direct translation of the old gaelic surname. During the penal codes in Irealnd the the O or Mac prefixes were dropped (O = "the grandson of.." Mac = " the son of..") and names were translated into English (Incorrectly more often than not) This is why the degaelicization of the 'O Reachtabhair' surname gave rise to 'Rafter' as it sounds similar to the gaelic name, the same can be said for Reachtabhra.
The surname comes from Reachtabhair,Reachtabhra,Rechtabrat a common first name during the 7-9 cents in Ireland. (old Irish for Reacht is Recht, The Irish for "Law and Order" is Riail agus Reacht)so you were right to assume that the name had something to do with the law. Brehon law was the law in Ireland at the time.
all native Irish surnames are derived from an ancestors first name, which go back into pre-history, as in this case Reachtabhra. and so all decendents of Reachtabhra now become O Reachtabhra (O Raftery).
Because this name was fairly common in early Ireland this led to variations in the name such as Reachtabhair, Rachtabhra, and so today we have many anglisized version of the surname. For example Rafter, Raftery, Rattigan, Wrafter, Raughter(Donegal), Raftiss (The latter is due to an old dialect of Irish spoken in Kilkenny, now lost), all the above surnames containing the 'Reacht' part in Irish.
Reacht is pronounced rokHt (Rocked) (where the kH sounds throaty like the 'ch' at the end of 'Loch')