Encode/Decode pair streams.