| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- package sys.io;
- import haxe.Int64;
- import haxe.io.Bytes;
- import haxe.io.Eof;
- import haxe.io.Output;
- import java.io.Exceptions;
- class NativeOutput extends Output
- {
- var stream:java.io.OutputStream;
- public function new(stream)
- {
- this.stream = stream;
- }
-
- override public function writeByte(c:Int):Void
- {
- try
- {
- stream.write(c);
- }
-
- catch (e:EOFException) {
- throw new Eof();
- }
-
- catch (e:IOException) {
- throw haxe.io.Error.Custom(e);
- }
- }
-
- override public function close():Void
- {
- try
- {
- stream.close();
- }
-
- catch (e:IOException) {
- throw haxe.io.Error.Custom(e);
- }
- }
-
- override public function flush():Void
- {
- try
- {
- stream.flush();
- }
-
- catch (e:IOException) {
- throw haxe.io.Error.Custom(e);
- }
- }
- }
|