Simple getBytes function - no checks for empty byte ranges