January 2018
Intermediate to advanced
434 pages
14h 1m
English
Attaching inputStream to a file returns the file contents as a stream of bytes. We can use a reader on the stream returned, or we can use the reader directly on the file. The read() method of inputStream reads the next byte in the stream. The readText() method returns the entire contents of the file as a string using UTF-8 or specified charset.
This readText() method is not recommended for huge files. It has an internal limitation of 2 GB file size. In case of a huge file, we read it byte by byte from the stream.
Read now
Unlock full access