'Replacing FileOutputStream with OutputStream in Java

I have a method that copies files. I desire to make some modifications in the method. Will it work the same if I replace the new FileOutputStream object present in it with OutputStream object? This OutputStream is from a socket.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source