Code example for StringWriter

Methods: close, toString

0
	} 
	 
	private void serializeConfig(ServerContainer.RuntimeConfig config, 
	                             WritableByteChannel destChannel) throws IOException
	{ 
      StringWriter out  = new StringWriter(10240);
      ObjectMapper mapper = new ObjectMapper();
      mapper.writeValue(out, config);
      out.close();
      byte[] dataBytes = out.toString().getBytes();
      destChannel.write(ByteBuffer.wrap(dataBytes));
	} 
	 
	private void doGetConfig(DatabusRequest request) throws IOException, 
			RequestProcessingException 
	{ 
		ServerContainer.RuntimeConfig config = request.getConfig();
		serializeConfig(config, request.getResponseContent());
	} 
 
	private void doPutConfig(DatabusRequest request) throws IOException,