code: @Override
      public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
          if (msg instanceof Observable) {
              @SuppressWarnings("rawtypes")
              Observable observable = (Observable) msg; /*One can write heterogeneous objects on a channel.*/
              final WriteStreamSubscriber subscriber = bytesWriteInterceptor.newSubscriber(ctx, promise);
              subscriber.subscribeTo(observable);
          } else {
              ctx.write(msg, promise);
          }
      }
docs: Intercepts a write on the channel. The following message types are handled:
  
  <ul>
  <li>String: If the pipeline is not configured to write a String, this converts the string to a {@link io.netty.buffer.ByteBuf} and
  then writes it on the channel.</li>
  <li>byte[]: If the pipeline is not configured to write a byte[], this converts the byte[] to a {@link io.netty.buffer.ByteBuf} and
  then writes it on the channel.</li>
  <li>Observable: Subscribes to the {@link Observable} and writes all items, requesting the next item if and only if
  the channel is writable as indicated by {@link Channel#isWritable()}</li>
  </ul>
  
  @param ctx Channel handler context.
  @param msg Message to write.
  @param promise Promise for the completion of write.
  
  @throws Exception If there is an error handling this write.