Not directly, no - getResourceAsStream()
is intended to return a view on read-only resources.
If you know that the resource is a writeable file, though, you can jump through some hoops, e.g.
URL resourceUrl = getClass().getResource(path);
File file = new File(resourceUrl.toURI());
OutputStream output = new FileOutputStream(file);
This should work nicely on unix-style systems, but windows file paths might give this indigestion. Try it and find out, though, you might be OK.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…