src/JavaVM.st
branchjk_new_structure
changeset 898 94eb1038a323
parent 895 ddeff39cfdb9
child 899 ac6820bae6ff
--- a/src/JavaVM.st	Tue Aug 09 12:00:45 2011 +0000
+++ b/src/JavaVM.st	Tue Aug 09 14:43:32 2011 +0000
@@ -3784,6 +3784,25 @@
     "Modified: / 14.1.1998 / 15:12:52 / cg"
 !
 
+_java_io_FileInputStream_close0: nativeContext
+
+    <javanative: 'java/io/FileInputStream' name: 'close0'>
+
+    | fdobj fd stream |
+    fdobj := (nativeContext receiver instVarNamed: #fd).
+    fd    := fdobj instVarNamed: #fd.
+    stream := self getOpenFileAt:fd.
+    stream notNil ifTrue:[
+        stream close.
+    ] ifFalse:[
+        self breakPoint: #jv.
+    ].
+    self setOpenFile: nil at: fd.
+    fdobj instVarNamed:#fd put: -1.
+
+    "Modified: / 09-08-2011 / 15:34:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 _java_io_FileInputStream_initIDs: nativeContext
 
     <javanative: 'java/io/FileInputStream' name: 'initIDs'>
@@ -4026,6 +4045,19 @@
     "Created: / 27-03-2011 / 15:32:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 !
 
+_java_io_UnixFileSystem_getLength: nativeContext
+
+    <javanative: 'java/io/UnixFileSystem' name: 'getLength'>
+
+    | file |
+
+    file := (Java as_ST_String: ((nativeContext argAt:1) instVarNamed: #path)) asFilename.
+    file exists ifFalse:[^0].
+    ^file fileSize
+
+    "Modified: / 09-08-2011 / 15:38:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 _java_io_UnixFileSystem_initIDs: aJavaContext
 
     <javanative: 'java/io/UnixFileSystem' name: 'initIDs'>