code: private static void encodeKey(ByteBuf buf, ByteBuf key) {
          if (key == null || !key.isReadable()) {
              return;
          }
  
          buf.writeBytes(key);
      }
docs: Encode the key.
  
  @param buf the {@link ByteBuf} to write into.
  @param key the key to encode.