You can't change an InputStream to an OutputStream. You need to close the FileInputStream, then open a FileOutputStream. If you simply wish to add to the end of the file, then you can (AFAIK) open in append mode. If you wish to "modify" the current contents of the file, then you need to write a new file, as you are reading the current file, making the modifications as you go, then close both Streams, remove the current file and rename the newfile to the original name.
Try
URL url = MyClass.class.getResource("whatever other file already exists");
File f = new File(url.toUri());
FileOutputStream fos = new FileOutputStream (f.getParent() + File.separator + "fileName");
Should work as long as the package is not in a jarfile.