code: private static BinaryMemcacheRequest handleGetRequest(final ChannelHandlerContext ctx, final GetRequest msg) {
          byte opcode;
          ByteBuf extras;
          if (msg.lock()) {
              opcode = OP_GET_AND_LOCK;
              extras = ctx.alloc().buffer().writeInt(msg.expiry());
          } else if (msg.touch()) {
              opcode = OP_GET_AND_TOUCH;
              extras = ctx.alloc().buffer().writeInt(msg.expiry());
          } else {
              opcode = OP_GET;
              extras = Unpooled.EMPTY_BUFFER;
          }
  
          byte[] key = msg.keyBytes();
          short keyLength = (short) key.length;
          byte extrasLength = (byte) extras.readableBytes();
          BinaryMemcacheRequest request = new DefaultBinaryMemcacheRequest(key);
          request
              .setOpcode(opcode)
              .setKeyLength(keyLength)
              .setExtras(extras)
              .setExtrasLength(extrasLength)
              .setTotalBodyLength(keyLength + extrasLength);
          return request;
      }
docs: Encodes a {@link GetRequest} into its lower level representation.
  
  Depending on the flags set on the {@link GetRequest}, the appropriate opcode gets chosen. Currently, a regular
  get, as well as "get and touch" and "get and lock" are supported. Latter variants have server-side side-effects
  but do not differ in response behavior.
  
  @param ctx the {@link ChannelHandlerContext} to use for allocation and others.
  @param msg the incoming message.
  @return a ready {@link BinaryMemcacheRequest}.