// setup output chain transformers
// stringToByteBuffer -> bytebuffertoarray -> framing ->
// buffer -> channelWriter
// (buffer sends only one byte per second)
BufferForwarder bufferTransformer = new BufferForwarder(
ByteBufferForwardingMode.DIRECT);
trafficShaperCoordinator = new TrafficShaperCoordinator(
Executors.newSingleThreadScheduledExecutor(), 1, 1000, false);
trafficShaperCoordinator.addTrafficShaper(this, bufferTransformer);
bufferTransformer.setNextForwarder(channelWriter);
FramingOutputTransformer framingOutputTransformer =
new FramingOutputTransformer(
FRAMING_HEADER_SIZE, ByteBufferForwardingMode.DIRECT);
framingOutputTransformer.setNextForwarder(bufferTransformer);
ByteBufferToArrayTransformer byteBufferToArrayTransformer =