pub fn from_env_with_capacity(
        capacity: usize,
        env: &'b JNIEnv<'a>,
        obj: JObject<'a>,
    ) -> Result<JOutputStream<'a, 'b>> {
        let class = env.auto_local(env.find_class("java/io/OutputStream")?);

        let write = env.get_method_id(&class, "write", "([BII)V")?;
        let flush = env.get_method_id(&class, "flush", "()V")?;

        let buffer = env.auto_local(env.new_byte_array(capacity as jsize)?);

        Ok(JOutputStream {
            internal: obj,
            buffer,
            buffer_len: capacity,
            write,
            flush,
            env,
        })
    }
/// Wrap an environment and an object that implements
/// `java.io.OutputStream`, specifying the capacity of the internal
/// buffer.
Wrap an environment and an object that implements
`java.io.OutputStream`, specifying the capacity of the internal
buffer.
Wrap an environment and an object that implements ` java . io . OutputStream ` specifying the capacity of the internal buffer .
pub fn from_env_with_capacity(
        capacity: usize,
        env: &'b JNIEnv<'a>,
        obj: JObject<'a>,
    ) -> Result<JOutputStream<'a, 'b>> {
        let class = env.auto_local(env.find_class("java/io/OutputStream")?);
        let write = env.get_method_id(&class, "write", "([BII)V")?;
        let flush = env.get_method_id(&class, "flush", "()V")?;
        let buffer = env.auto_local(env.new_byte_array(capacity as jsize)?);
        Ok(JOutputStream {
            internal: obj,
            buffer,
            buffer_len: capacity,
            write,
            flush,
            env,
        })
    }
pub fn from_env_with_capacity ( capacity : usize , env : & ' b JNIEnv < ' a > , obj : JObject < ' a > , ) -> Result < JOutputStream < ' a , ' b > > { let class = env . auto_local ( env . find_class ( " " ) ? ) ; let write = env . get_method_id ( & class , " " , " " ) ? ; let flush = env . get_method_id ( & class , " " , " " ) ? ; let buffer = env . auto_local ( env . new_byte_array ( capacity as jsize ) ? ) ; Ok ( JOutputStream { internal : obj , buffer , buffer_len : capacity , write , flush , env , } ) }
Wrap an environment and an object that implements
`java.io.OutputStream`, specifying the capacity of the internal
buffer.
Wrap an environment and an object that implements ` java . io . OutputStream ` specifying the capacity of the internal buffer .
capacity
usize
env
&'b JNIEnv<'a>
obj
JObject<'a>