Added optimistic encoding to streams.