Hex encode/decode stream