code: private static FullMemcacheMessage toFullMessage(final MemcacheMessage msg) {
          if (msg instanceof FullMemcacheMessage) {
              return ((FullMemcacheMessage) msg).retain();
          }
  
          FullMemcacheMessage fullMsg;
          if (msg instanceof BinaryMemcacheRequest) {
              fullMsg = toFullRequest((BinaryMemcacheRequest) msg, Unpooled.EMPTY_BUFFER);
          } else if (msg instanceof BinaryMemcacheResponse) {
              fullMsg = toFullResponse((BinaryMemcacheResponse) msg, Unpooled.EMPTY_BUFFER);
          } else {
              throw new IllegalStateException();
          }
  
          return fullMsg;
      }
docs: Convert a invalid message into a full message.
  
  This method makes sure that upstream handlers always get a full message returned, even
  when invalid chunks are failing.
  
  @param msg the message to transform.
  @return a full message containing parts of the original message.