|
@@ -8,6 +8,7 @@ import python.io.IInput;
|
|
|
import python.io.IoTools;
|
|
|
import python.io.NativeInput;
|
|
|
import python.lib.Builtin;
|
|
|
+import python.lib.ByteArray;
|
|
|
import python.lib.io.RawIOBase;
|
|
|
import python.lib.io.IOBase.SeekSet;
|
|
|
import python.lib.io.TextIOBase;
|
|
@@ -34,22 +35,8 @@ class NativeTextInput extends NativeInput<TextIOBase> implements IInput {
|
|
|
IoTools.seekInTextMode(stream, tell, p, pos);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- override public function readBytes(s:haxe.io.Bytes, pos:Int, len:Int):Int
|
|
|
- {
|
|
|
- throw "not implemented";
|
|
|
- /*
|
|
|
- if( pos < 0 || len < 0 || pos + len > s.length )
|
|
|
- throw haxe.io.Error.OutsideBounds;
|
|
|
-
|
|
|
- stream.seek(pos, python.lib.io.IOBase.SeekSet.SeekCur);
|
|
|
- var ba = Builtin.bytearray(len);
|
|
|
- var ret = stream.readinto(ba);
|
|
|
- s.blit(pos, haxe.io.Bytes.ofData(ba) ,0,len);
|
|
|
- if (ret == 0)
|
|
|
- throwEof();
|
|
|
- return ret;
|
|
|
- */
|
|
|
+ override function readinto (b:ByteArray):Int {
|
|
|
+ return stream.buffer.readinto(b);
|
|
|
}
|
|
|
|
|
|
}
|