getResoureAsStream () works with resources. Returning the output stream does not make sense, because it means that you are trying to overwrite your resources on the fly.
Also, for most resources located in the JAR or remote locations, you still cannot write.
source
share