






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







BufferedInputStream bis = new BufferedInputStream(fis);FileInputStream fis = new FileInputStream(myFile);
input stream interface
File read skip close
bufferread skip close
Remember to Write a program that copies a file three different ways:
(^) close()
(^) any file you read and to
(^) flush()
, then
(^) close()
any file you write. 1. (^) Use the single-byte
(^) read()
(^) and
(^) write()
(^) methods to copy a file, using
unbuffered
(^) FileInputStream
(^) and
(^) FileOutputStream
. (Lab 9b)
(^) Use the block methods,
(^) read(buffer)
(^) and
(^) write(buffer, offset,
length)
(^) to copy the same file using manual buffers. (Lab 9b)
. Use the single-byte
(^) read()
(^) and
(^) write()
(^) methods with a
BufferedInputStream
(^) and
(^) BufferedOutputStream
(^) to copy the same file.
3a
. Keep in mind that you can get unpredictable results if you read or write 4. possibility of randomly rearranging the bytes in the file.both the file stream and the buffer stream alternatively. This has the (^) Use
(^) System.currentTimeMillis()
(^) to time the three implementations.
This method returns a
(^) long
(^) containing the current system clock in
the two copies. Note any performance differences.milliseconds. Measure the difference in time ticks between the start and end of