OutputStream
is a class. Corresponds to an object that writes sequences of bytes somewhere.
There are several other objects that have one method called getOutputStream()
which, as the name implies, returns an object of the type OutputStream
(or any of his subclasses).
Finally, the getOutputStream()
is the method you call to obtain an instance of a OutputStream
to write something somewhere.
The place where the writing will occur depends on the instance of the OutputStream
obtained, and therefore depends on the object that has the method getOutputStream()
.
Related: https://answall.com/a/142604/132
– Victor Stafusa