DESCRIPTION

JCBC-1062: Optimize LegacyTranscoder encoding for strings

Motivation
----------
The LegacyTranscoder still uses the slower JVM-based encoding for
strings and it rather should use the same optimized encoding
path which we use for RawJsonDocument and others.

Modifications
-------------
This code adds a "fastpath" for the string encoding and moves
all the other options into a nested else block so that the buffer
is only allocated if needed (and not twice w/ overridden by the
optimized method).

Result
------
Faster encoding for the string path.

Change-Id: Id67e7f7b905491b3bb5be5f1bf0552a3fd264b79
Reviewed-on: http://review.couchbase.org/75774
Reviewed-by: Cory Peck xxx@xxx.xxx
Tested-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-by: Marques Ellis xxx@xxx.xxx


COMMENTS

author: Natasha Sullivan
date: 2017-03-28 07:06:43.230000000

Change has been successfully cherry-picked as 5666c32355f2dd4b2f7344cb5fcfa13e0c8005ac by Natasha Sullivan

-------------------------------------
