code: private static BinaryMemcacheRequest handleCounterRequest(final ChannelHandlerContext ctx,
          final CounterRequest msg) {
          ByteBuf extras = ctx.alloc().buffer();
          extras.writeLong(Math.abs(msg.delta()));
          extras.writeLong(msg.initial());
          extras.writeInt(msg.expiry());
  
          byte[] key = msg.keyBytes();
          short keyLength = (short) key.length;
          byte extrasLength = (byte) extras.readableBytes();
          BinaryMemcacheRequest request = new DefaultBinaryMemcacheRequest(key, extras);
          request.setOpcode(msg.delta() < 0 ? OP_COUNTER_DECR : OP_COUNTER_INCR);
          request.setKeyLength(keyLength);
          request.setTotalBodyLength(keyLength + extrasLength);
          request.setExtrasLength(extrasLength);
          return request;
      }
docs: Encodes a {@link CounterRequest} into its lower level representation.
  
  Depending on if the {@link CounterRequest#delta} is positive or negative, either the incr or decr memcached
  commands are utilized. The value is converted to its absolute variant to conform with the protocol.
  
  @return a ready {@link BinaryMemcacheRequest}.