this should be just a function not member of the class binary_reader because it doesn't require access to the inner class state.