internal/buffer: use switch-case vs ifs in 1-6 width (u)int read/write calls
Additionally reorganises the return statements to be decremental to increase readability; and removes blank/dupe lines.
Minor v8 optimisation as well due to the use of switch statements vs if-chaining; as well as a shorter; denser codebase.
I'm not sure on our thoughts on switch()-case vs if()-expr so it's primarily nitpicking.
Checklist
-
tests and/or benchmarks are included -
commit message follows commit guidelines