flush stream after every write
fixed jni camera bugs