Use DataInputStream and DataOutputStream classes, to read from the keyboard a set of integers, store them in a file. Then open the same file again for reading and calculate the number of lines, sum, and find the maximum number. Follow the steps bellow:
1. Create the method writeData(OutputStream out), to:
a. Create DataOutputStream object to be associated with out.
b. Read integer data from keyboard
c. Write data to out
d. Repeat steps b and c till end of file is read.
e. Close the DataOutputStream.
2. Create the method readData(InputStream in), to
a. Create DataInputStream object to be associated with in.
b. Read integer data from in.
c. Calculate the sum, max, and number of lines in the file
d. Repeat steps b and c till end of file is read.
e. Display the result (sum, max and number of lines) in the standard output device.
f. Close the DataInputStream.
3. In the main() method:
a. Create two Streams, one to read from the file "data" and one to write to it.
b. Call the writeData() method first, after that call readData()
c. Close both streams.