Functions for parsing/emitting binary streams.