I am creating a project in java in which i am converting the project into jar file containing a text file along with it. But i googled and found out getResourceAsStream() has to be used to obtain the file which is embedded along with jar file for processing.So i done that and it was working fine for reading the contents of the file using scanner passing inputstream as parameter. But now my problem is how to write to a file got from an inputstream using printwriter and filewriter.
InputStream stream = Sample_Test.class.getResourceAsStream("/resources/Project_Names.txt")
So please guide me how to write a string the following file.