2
0
Caue Waneck 12 жил өмнө
parent
commit
99c88347d1

+ 18 - 17
std/java/_std/sys/io/FileInput.hx

@@ -24,7 +24,8 @@ import haxe.Int64;
 import haxe.io.Bytes;
 import haxe.io.Eof;
 import haxe.io.Input;
-import java.io.Exceptions;
+import java.io.EOFException;
+import java.io.IOException;
 
 /**
 	Use [sys.io.File.read] to create a [FileInput]
@@ -35,45 +36,45 @@ class FileInput extends Input {
 	{
 		this.f = f;
 	}
-	
-	override public function readByte():Int 
+
+	override public function readByte():Int
 	{
 		try
 		{
 			return f.readUnsignedByte();
 		}
-		
+
 		catch (e:EOFException) {
 			throw new Eof();
 		}
-		
+
 		catch (e:IOException) {
 			throw haxe.io.Error.Custom(e);
 		}
 	}
-	
-	override public function readBytes(s:Bytes, pos:Int, len:Int):Int 
+
+	override public function readBytes(s:Bytes, pos:Int, len:Int):Int
 	{
 		var ret = 0;
 		try
 		{
 			ret = f.read(s.getData(), pos, len);
 		}
-		
+
 		catch (e:EOFException) {
 			throw new Eof();
 		}
-		
+
 		catch (e:IOException) {
 			throw haxe.io.Error.Custom(e);
 		}
 
 		if (ret == -1)
 			throw new Eof();
-		
+
 		return ret;
 	}
-	
+
 	public function seek( p : Int, pos : FileSeek ) : Void
 	{
 		try
@@ -85,35 +86,35 @@ class FileInput extends Input {
 				case SeekEnd: f.seek(haxe.Int64.add(f.length(), cast p));
 			}
 		}
-		
+
 		catch (e:EOFException) {
 			throw new Eof();
 		}
-		
+
 		catch (e:IOException) {
 			throw haxe.io.Error.Custom(e);
 		}
 	}
-	
+
 	public function tell() : Int
 	{
 		try
 		{
 			return cast f.getFilePointer();
 		}
-		
+
 		catch (e:IOException) {
 			throw haxe.io.Error.Custom(e);
 		}
 	}
-	
+
 	public function eof() : Bool
 	{
 		try
 		{
 			return f.getFilePointer() == f.length();
 		}
-		
+
 		catch (e:IOException) {
 			throw haxe.io.Error.Custom(e);
 		}

+ 15 - 15
std/java/_std/sys/io/FileOutput.hx

@@ -23,8 +23,8 @@ package sys.io;
 import haxe.io.Bytes;
 import haxe.io.Eof;
 import haxe.io.Output;
-
-import java.io.Exceptions;
+import java.io.EOFException;
+import java.io.IOException;
 
 /**
 	Use [sys.io.File.write] to create a [FileOutput]
@@ -35,44 +35,44 @@ class FileOutput extends Output {
 	{
 		this.f = f;
 	}
-	
-	override public function writeByte(c:Int):Void 
+
+	override public function writeByte(c:Int):Void
 	{
 		try
 		{
 			this.f.write(c);
 		}
-		
+
 		catch (e:IOException) {
 			throw haxe.io.Error.Custom(e);
 		}
 	}
-	
-	override public function write(s:Bytes):Void 
+
+	override public function write(s:Bytes):Void
 	{
 		try
 		{
 			this.f.write(s.getData());
 		}
-		
+
 		catch (e:IOException) {
 			throw haxe.io.Error.Custom(e);
 		}
 	}
-	
-	override public function writeBytes(s:Bytes, pos:Int, len:Int):Int 
+
+	override public function writeBytes(s:Bytes, pos:Int, len:Int):Int
 	{
 		try
 		{
 			this.f.write(s.getData(), pos, len);
 			return len;
 		}
-		
+
 		catch (e:IOException) {
 			throw haxe.io.Error.Custom(e);
 		}
 	}
-	
+
 	public function seek( p : Int, pos : FileSeek ) : Void
 	{
 		try
@@ -87,19 +87,19 @@ class FileOutput extends Output {
 		catch (e:EOFException) {
 			throw new Eof();
 		}
-		
+
 		catch (e:IOException) {
 			throw haxe.io.Error.Custom(e);
 		}
 	}
-	
+
 	public function tell() : Int
 	{
 		try
 		{
 			return cast f.getFilePointer();
 		}
-		
+
 		catch (e:IOException) {
 			throw haxe.io.Error.Custom(e);
 		}