private List<Object> processMultiBulkReply(final RedisInputStream is) { int num = Integer.parseInt(is.readLine()); if (num == -1) { return null; } List<Object> ret = new ArrayList<Object>(num); for (int i = 0; i < num; i++) { ret.add(process(is)); } return ret; }
private byte[] processBulkReply(final RedisInputStream is) { int len = Integer.parseInt(is.readLine()); if (len == -1) { return null; } byte[] read = new byte[len]; int offset = 0; try { while (offset < len) { offset += is.read(read, offset, (len - offset)); } // read 2 more bytes for the command delimiter is.readByte(); is.readByte(); } catch (IOException e) { throw new JedisConnectionException("protocol -> processBulkReply IOException"); } return read; }
private byte[] processStatusCodeReply(final RedisInputStream is) { return SafeEncoder.encode(is.readLine()); }
private void processError(final RedisInputStream is) { String message = is.readLine(); throw new JedisDataException(message); }
private Long processInteger(final RedisInputStream is) { String num = is.readLine(); return Long.valueOf(num); }