image - What is the most efficient way to transfer pictures over wifi from FlashAir in Java8? -
i'm creating program reads pictures (jpg max size 10mb per file) flashair they're taken, display them in bigger screen review , saved them local folder. paramount reduce time moment picture taken until displayed user , prevent loss of quality (they macro pictures). now, camera works jpg, changing not option moment. pictures must saved locally in maximum possible quality.
i wondering best way achieve this. since flashair card in camera , moves around, bottleneck in wireless transfer (max speed 54 mb/s).
the picture displayed withing java app or sent different app editing, want reduce i/o operations (i don't want have re-read picture once saved locally display it).
what best way achieve using pure java 8 classes?
my test implementation uses imageio.read() , imageio.write() methods. problems have approach takes long time picture displayed (it read saved folder) , image re-encoded , compressed, loosing quality compared original file in sd card.
i feel should way transfer bytes efficiently on network first , run 2 parallel processes save untouched bytes disk , decode , display image (image potentially edited , saved disk different location).
i don't need working example. main concern java 8 i/o classes best suited job , know if approach best 1 achieve results.
edit
after research thinking of using readablebytechannel storage picture bytes in bytebuffer , pass copies of 2 jobs run in parallel: 1 saving bytes use filechannel , 1 displaying image use them create imageicon.
i don't know if there better/recommended approach.
Comments
Post a Comment