General binary type serialization.