createStream with conversion

Refactored the createStream functions in ConnFactory
createStream works with conversion in both Output and Input sides