implement read_header in Sink