Abstract class for handling input streams of byte.
Extending subclasses are FileInputStream, ByteArrayInputStream, ObjectInputStream, BufferedInputStream.
Due to being an abstract class, for declaration use constructor of a subclass.
Processing of the stream is sequential: after reading the given amount of data, the position will shift as well, the next reading will start from there.
In case a method tries to access data after the end of the source (accessed length is greater than the actually available), exception raises.
The stream must be closed after processing in order to release the source.
After closing the stream, any method will raise exception.
The InputStream implements the AutoClosable interface, the try-with-resources statement can be used to ensure proper closing.
EXAMPLE FOR USAGE:
EXAMPLE FOR USAGE WITH TRY-WITH-RESOURCES: