Remove read_segment_header_device and unified with read_whole_segment
Refactor
Fix a bug. Change ">>" to "<<"