Added stop and save
If stop_and_save is true, the data in buffer is also written to file, the writer returns running state.
Closes #16
If stop_and_save is true, the data in buffer is also written to file, the writer returns running state.
Closes #16