Merge: Apply serialization in calculator, a_star, more_collections, Couple and Container
[nit.git] / contrib / online_ide / sources / nit / pnacl_nit.nit
index 7d0e701..2017a0b 100644 (file)
@@ -63,8 +63,8 @@ redef class ToolContext
        end
 end
 
-# We have to redef some IFStream methods because we don't use NativeFiles anymore.
-redef class IFStream
+# We have to redef some FileReader methods because we don't use NativeFiles anymore.
+redef class FileReader
 
        # Looks in the 'files' HashMap.
        redef init open(path: String)
@@ -72,7 +72,7 @@ redef class IFStream
                self.path = path
                var file = sys.files[path]
                prepare_buffer(file.length)
-               _buffer.append(file)
+               path.copy_to_native(_buffer, file.length, 0, 0)
        end
 
        redef fun close
@@ -82,7 +82,7 @@ redef class IFStream
 
        redef fun fill_buffer
        do
-               _buffer.clear
+               buffer_reset
                end_reached = true
        end