@@ -31,6 +31,7 @@ impl RandomAccessFile {
3131 JavaMethodProto :: new( "write" , "([BII)V" , Self :: write_offset_length, Default :: default ( ) ) ,
3232 JavaMethodProto :: new( "length" , "()J" , Self :: length, Default :: default ( ) ) ,
3333 JavaMethodProto :: new( "getFilePointer" , "()J" , Self :: get_file_pointer, Default :: default ( ) ) ,
34+ JavaMethodProto :: new( "getFD" , "()Ljava/io/FileDescriptor;" , Self :: get_fd, Default :: default ( ) ) ,
3435 JavaMethodProto :: new( "seek" , "(J)V" , Self :: seek, Default :: default ( ) ) ,
3536 JavaMethodProto :: new( "setLength" , "(J)V" , Self :: set_length, Default :: default ( ) ) ,
3637 JavaMethodProto :: new( "close" , "()V" , Self :: close, Default :: default ( ) ) ,
@@ -193,6 +194,14 @@ impl RandomAccessFile {
193194 Ok ( pos as i64 )
194195 }
195196
197+ async fn get_fd ( jvm : & Jvm , _: & mut RuntimeContext , this : ClassInstanceRef < Self > ) -> Result < ClassInstanceRef < File > > {
198+ tracing:: debug!( "java.io.RandomAccessFile::getFD({:?})" , & this) ;
199+
200+ let fd = jvm. get_field ( & this, "fd" , "Ljava/io/FileDescriptor;" ) . await ?;
201+
202+ Ok ( fd)
203+ }
204+
196205 async fn close ( _jvm : & Jvm , _: & mut RuntimeContext , this : ClassInstanceRef < Self > ) -> Result < ( ) > {
197206 tracing:: debug!( "java.io.RandomAccessFile::close({:?})" , & this) ;
198207
0 commit comments