Check out example codes for "bufferedwriter doesn't write to file". It will help you in understanding the concepts better.

Code Example 1

// Make sure you close your writer like this:
myWriter.close();

Learn ReactJs, React Native from akashmittal.com