A lof of these methods follow the same pattern (read n times, shift n times), I assume you can't make helper methods because you don't want any extra loops / method calls?