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 ( ) ; } }
Store to yaml .