added utility to read variable byte width data with unit tests