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