Minimize output stream allocations

Addresses issues #779 and #775. Added a Protocol stream benchmark and measured a 73% increase for Multi Bulk and 87% increase for Status Reply.  The greatly reduces the number of temporary objects created and encoded for reading results. It also ensures that we will hear about it if a stream is not fully read. In the currently implementation a stream error could cause readByte to return -1 even though a byte is required by the protocol. All unit tests and benchmarks pass.
Exactly, all the IOExceptions in RedisInputStream are now handled and
converted to JedisConnectionExceptions in one place instead of two files.

On Wed, Oct 22, 2014 at 3:16 PM, Jungtaek Lim <notifications@github.com>
wrote:

> In src/main/java/redis/clients/jedis/Protocol.java:
>
> > -	    if (b == MINUS_BYTE) {
> > -		processError(is);
> > -	    } else if (b == ASTERISK_BYTE) {
> > -		return processMultiBulkReply(is);
> > -	    } else if (b == COLON_BYTE) {
> > -		return processInteger(is);
> > -	    } else if (b == DOLLAR_BYTE) {
> > -		return processBulkReply(is);
> > -	    } else if (b == PLUS_BYTE) {
> > -		return processStatusCodeReply(is);
> > -	    } else {
> > -		throw new JedisConnectionException("Unknown reply: " + (char) b);
> > -	    }
> > -	} catch (IOException e) {
> > -	    throw new JedisConnectionException(e);
> > +
>
> Does RedisInputStream ensure that all of IOException are converted to
> JedisConnectionException?
> Catching a glimpse it seems to ensure. So it's for reminding.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/xetorthio/jedis/pull/780/files#r19248401>.
>