瀏覽代碼

[lua] set byte flag during reads for File.getBytes

Justin Donaldson 9 年之前
父節點
當前提交
aba2cd14ab
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      std/lua/_std/sys/io/File.hx

+ 4 - 1
std/lua/_std/sys/io/File.hx

@@ -44,7 +44,10 @@ class File {
 	}
 
 	public static function getBytes( path : String ) : haxe.io.Bytes {
-		return haxe.io.Bytes.ofString(getContent(path));
+		var finput = read(path, true);
+		var res = finput.readAll();
+		finput.close();
+		return res;
 	}
 
 	public static function read( path : String, binary : Bool = true ) : FileInput {