diff --git a/src/com/esotericsoftware/yamlbeans/YamlReader.java b/src/com/esotericsoftware/yamlbeans/YamlReader.java index 52aba27..4fc2486 100644 --- a/src/com/esotericsoftware/yamlbeans/YamlReader.java +++ b/src/com/esotericsoftware/yamlbeans/YamlReader.java @@ -28,6 +28,7 @@ import com.esotericsoftware.yamlbeans.scalar.ScalarSerializer; import com.esotericsoftware.yamlbeans.tokenizer.Tokenizer.TokenizerException; +import java.io.Closeable; import java.io.FileReader; import java.io.IOException; import java.io.Reader; @@ -42,7 +43,7 @@ /** Deserializes Java objects from YAML. * @author Nathan Sweet */ -public class YamlReader { +public class YamlReader implements Closeable { private final YamlConfig config; Parser parser; private final Map anchors = new HashMap(); @@ -430,4 +431,4 @@ public static void main (String[] args) throws Exception { YamlReader reader = new YamlReader(new FileReader("test/test.yml")); System.out.println(reader.read()); } -} \ No newline at end of file +} diff --git a/src/com/esotericsoftware/yamlbeans/YamlWriter.java b/src/com/esotericsoftware/yamlbeans/YamlWriter.java index fd9db01..ae53601 100644 --- a/src/com/esotericsoftware/yamlbeans/YamlWriter.java +++ b/src/com/esotericsoftware/yamlbeans/YamlWriter.java @@ -16,6 +16,7 @@ package com.esotericsoftware.yamlbeans; +import java.io.Closeable; import java.io.IOException; import java.io.Writer; import java.lang.reflect.Array; @@ -46,7 +47,7 @@ /** Serializes Java objects as YAML. * @author Nathan Sweet */ -public class YamlWriter { +public class YamlWriter implements Closeable { private final YamlConfig config; private final Emitter emitter; private boolean started;