if (_serializer != null) {
_serializer.setOutputStream(out);
return _serializer;
} else {
WSTCPCodecConfigurator configurator = WSTCPCodecConfigurator.INSTANCE;
StAXDocumentSerializer serializer = configurator.getDocumentSerializerFactory().newInstance();
serializer.setOutputStream(out);
if (_retainState) {
SerializerVocabulary vocabulary = configurator.getSerializerVocabularyFactory().newInstance();
serializer.setVocabulary(vocabulary);
serializer.setMinAttributeValueSize(
configurator.getMinAttributeValueSize());
serializer.setMaxAttributeValueSize(
configurator.getMaxAttributeValueSize());
serializer.setMinCharacterContentChunkSize(
configurator.getMinCharacterContentChunkSize());
serializer.setMaxCharacterContentChunkSize(
configurator.getMaxCharacterContentChunkSize());
serializer.setAttributeValueMapMemoryLimit(
configurator.getAttributeValueMapMemoryLimit());
serializer.setCharacterContentChunkMapMemoryLimit(
configurator.getCharacterContentChunkMapMemoryLimit());
}
_serializer = serializer;
return serializer;
}