+ /**
+ * This class is not marked as shared, so it can be attached to only a single channel,
+ * which means that {@link #encode(ChannelHandlerContext, NetconfMessage, ByteBuf)}
+ * cannot be invoked concurrently. Hence we can reuse the transmogrifier.
+ */
+ private final Transmogrifier transmogrifier;
+
+ private NetconfMessageToEXIEncoder(final Transmogrifier transmogrifier) {
+ this.transmogrifier = Preconditions.checkNotNull(transmogrifier);
+ }