@@ -20,6 +20,7 @@ impl ByteArrayOutputStream {
2020 JavaMethodProto :: new( "write" , "(I)V" , Self :: write, Default :: default ( ) ) ,
2121 JavaMethodProto :: new( "toByteArray" , "()[B" , Self :: to_byte_array, Default :: default ( ) ) ,
2222 JavaMethodProto :: new( "size" , "()I" , Self :: size, Default :: default ( ) ) ,
23+ JavaMethodProto :: new( "reset" , "()V" , Self :: reset, Default :: default ( ) ) ,
2324 JavaMethodProto :: new( "close" , "()V" , Self :: close, Default :: default ( ) ) ,
2425 ] ,
2526 fields : vec ! [
@@ -93,6 +94,14 @@ impl ByteArrayOutputStream {
9394 Ok ( pos)
9495 }
9596
97+ async fn reset ( jvm : & Jvm , _: & mut RuntimeContext , mut this : ClassInstanceRef < Self > ) -> Result < ( ) > {
98+ tracing:: debug!( "java.io.ByteArrayOutputStream::reset({:?})" , & this) ;
99+
100+ jvm. put_field ( & mut this, "pos" , "I" , 0 ) . await ?;
101+
102+ Ok ( ( ) )
103+ }
104+
96105 async fn close ( _jvm : & Jvm , _: & mut RuntimeContext , this : ClassInstanceRef < Self > ) -> Result < ( ) > {
97106 tracing:: debug!( "java.io.ByteArrayOutputStream::close({this:?})" ) ;
98107
0 commit comments