Use StreamUtil instead
No need to use 2 try blocks.
No need to flush before close
Regenerate
SF