code: public void storeToYAML(final OutputStream os) throws IOException {
  		lock.readLock().lock();
  		try {
  			final YAMLFactory f = new YAMLFactory();
  			final YAMLGenerator generator = f.createGenerator(os, JsonEncoding.UTF8);
  			generator.useDefaultPrettyPrinter();
  
  			generator.writeStartObject();
  			writeJsonOrYaml(generator, getTreeMap());
  			generator.writeEndObject();
  			generator.flush();
  		} finally {
  			lock.readLock().unlock();
  		}
  	}
docs: Store to yaml.
  
  @param os
  the os
  @throws IOException
  Signals that an I/O exception has occurred.