I have a java program where I am writing to a file using OutputStream
. Everything is working fine. Upon completion of the program, I see data in my file. However, I would like to see this data on the System.out
as well.
How can I convert OutputStream
to a String
so that I can simply System.out.println();
it? I tried fos.toString()
but that prints java.io.FileOutputStream@1ed2e55e