public void dumpStream(Iterator iterator, File file, boolean minimalOutput) throws FileNotFoundException { YamlEncoder enc = new YamlEncoder(new FileOutputStream(file), (YamlConfig) this.clone()); enc.setMinimalOutput(minimalOutput); while (iterator.hasNext()) enc.writeObject(iterator.next()); enc.close(); }
public String dumpStream(Iterator iterator, boolean minimalOutput) { ByteArrayOutputStream out = new ByteArrayOutputStream(); YamlEncoder enc = new YamlEncoder(out, (YamlConfig) this.clone()); enc.setMinimalOutput(minimalOutput); while (iterator.hasNext()) enc.writeObject(iterator.next()); enc.close(); try { return new String(out.toByteArray(), getEncoding()); } catch (UnsupportedEncodingException e) { throw new YamlException("Unsupported encoding " + getEncoding()); } }
public void dump(Object obj, OutputStream out, boolean minimalOutput) { YamlEncoder enc = new YamlEncoder(out, (YamlConfig) this.clone()); enc.setMinimalOutput(minimalOutput); enc.writeObject(obj); enc.close(); }
public void dump(Object obj, File file, boolean minimalOutput) throws FileNotFoundException { YamlEncoder enc = new YamlEncoder(new FileOutputStream(file), (YamlConfig) this.clone()); enc.setMinimalOutput(minimalOutput); enc.writeObject(obj); enc.close(); }