Skip to content

Commit

Permalink
Improve NativeOutput performance
Browse files Browse the repository at this point in the history
  • Loading branch information
barisyild authored Jan 26, 2025
1 parent b7fce0e commit 7301e55
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions std/jvm/io/NativeOutput.hx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ import java.io.IOException;
}
}

override public function writeBytes(s:Bytes, pos:Int, len:Int) {
if (pos < 0 || len < 0 || pos + len > s.length)
throw haxe.io.Error.OutsideBounds;
try {
stream.write(s.getData(), pos, len);
} catch (e:EOFException) {

throw new Eof();
} catch (e:IOException) {
throw haxe.io.Error.Custom(e);
}
return len;
}

override public function close():Void {
try {
stream.close();
Expand Down

0 comments on commit 7301e55

Please sign in to comment.