Modify this chapters WebPageReader program to read a web page through a buffer. Instead of importing InputStream,

Question:

Modify this chapter’s WebPageReader program to read a web page through a buffer.

Instead of importing InputStream, import BufferedReader and InputStreamReader.

Instead of:

instream = webIn = connection.getInputStream(); new Scanner (instream);

use:

reader new Buffered Reader ( new InputStreamReader (connection.getInputStream())); =

And instead of:

while (i < maxI && webIn.nextLine()) { } System.out.println(webIn.nextLine()); i++;

use:

for (int i=0; i < maxI; i++) { } System.out.println(reader.readLine()); First sample session: Enter a full

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: