Abstract class for handling output streams of byte.
Extending subclasses are FileOutputStream, ByteArrayOutputStream, ObjectOutputStream, BufferedOutputStream and PrintStream.
Due to being an abstract class, for declaration use constructor of a subclass.
The stream must be closed after processing in order to release the source.
After closing the stream, any method will raise exception.
The OutputStream implements the AutoClosable interface, the try-with-resources statement can be used to ensure proper closing.
The concept behind the output streams is similar to the StringBuilder (appending several sequences of data) but in this case, it works with bytes.
EXAMPLE FOR USAGE:
EXAMPLE FOR USAGE WITH TRY-WITH-RESOURCES: