write bytes to file - How to speed up applications using threads in java