throw new IllegalArgumentException("StanzaWriterProtocolEncoder only handles StanzaWriteInfo objects");
}
StanzaWriteInfo stanzaWriteInfo = (StanzaWriteInfo) o;
Stanza element = stanzaWriteInfo.getStanza();
Renderer renderer = new Renderer(element);
IoBuffer byteBuffer = IoBuffer.allocate(16).setAutoExpand(true);
if (stanzaWriteInfo.isWriteProlog()) byteBuffer.putString(StanzaWriter.XML_PROLOG, getSessionEncoder());
if (stanzaWriteInfo.isWriteOpeningElement()) byteBuffer.putString(renderer.getOpeningElement(), getSessionEncoder());
if (stanzaWriteInfo.isWriteContent()) byteBuffer.putString(renderer.getElementContent(), getSessionEncoder());
if (stanzaWriteInfo.isWriteClosingElement()) byteBuffer.putString(renderer.getClosingElement(), getSessionEncoder());
byteBuffer.flip();
protocolEncoderOutput.write(byteBuffer);
}