Reorganized the fileoutputstream

Still might not work with writing...