BufferedWriter not writing everything to its output file
You need to close your OutputStream which will flush the remainder of your data: out.close(); The default buffer size for BufferedWriter is 8192 characters, large enough to easily hold hundreds of lines of unwritten data.