To see whether you took a big enough byte from the tree of knowledge during this hour, answer the following questions about input and output streams in Java.
Which of the following techniques can be used to convert an array of bytes into a string?
Call the array's toString() method.
Convert each byte to a character, and then assign each one to an element in a String array.
Call the String() constructor method with the array as an argument.
What kind of stream is used to read from a file in a Java program?
What method of the File class can be used to determine the size of a file?
c. You can deal with each byte individually, as suggested in answer b., but you can easily create strings from other data types.
a. An input stream is created from a File object or by providing a filename to the input stream's constructor method.
c. This method returns a long representing the number of bytes in the stream.