code: public void resetOutputBuffer()
      {
          int shrunkenSize = shrinkBufferSize();
  
          if (outputBuffer.writerIndex() < shrunkenSize) {
              // Less than the shrunken size of the buffer was actually used, so increment
              // the under-use counter
              ++bufferUnderUsedCounter;
          }
          else {
              // More than the shrunken size of the buffer was actually used, reset
              // the counter so we won't shrink the buffer soon
              bufferUnderUsedCounter = 0;
          }
  
          if (shouldShrinkBuffer()) {
              outputBuffer = ChannelBuffers.dynamicBuffer(shrunkenSize);
              bufferUnderUsedCounter = 0;
          } else {
              outputBuffer.clear();
          }
      }
docs: Resets the state of this transport so it can be used to write more messages