Parcourir la source

[java] close() for FileInput/FileOutput

Caue Waneck il y a 12 ans
Parent
commit
e16e543062
2 fichiers modifiés avec 10 ajouts et 0 suppressions
  1. 5 0
      std/java/_std/sys/io/FileInput.hx
  2. 5 0
      std/java/_std/sys/io/FileOutput.hx

+ 5 - 0
std/java/_std/sys/io/FileInput.hx

@@ -37,6 +37,11 @@ class FileInput extends Input {
 		this.f = f;
 		this.f = f;
 	}
 	}
 
 
+	override public function close()
+	{
+		try f.close() catch(e:Dynamic) throw e;
+	}
+
 	override public function readByte():Int
 	override public function readByte():Int
 	{
 	{
 		try
 		try

+ 5 - 0
std/java/_std/sys/io/FileOutput.hx

@@ -36,6 +36,11 @@ class FileOutput extends Output {
 		this.f = f;
 		this.f = f;
 	}
 	}
 
 
+	override public function close()
+	{
+		try f.close() catch(e:Dynamic) throw e;
+	}
+
 	override public function writeByte(c:Int):Void
 	override public function writeByte(c:Int):Void
 	{
 	{
 		try
 		try