Corrections to Chapter 10 of Java Network Programming, The URLConnection Class

p. 248: In paragraph 1 near the top of the page "almost the same as Example 5-5" should be "almost the same as Example 5-6".

p. 252: Change

uc.getHeaderField("content-encoding"));

to

uc.getHeaderField("content-encoding");

That is, delete the extra closing parenthesis.

p. 253: Change "The first header is zero." to "The first MIME header is one." in both the third and fourth paragraphs of body text.

p. 268: In the saveBinaryFile() method of Example 10-13, there's a likely IndexOutOfBoundsException. To fix it, change,

bytesread = theImage.read(b, offset, bfr);

to

bytesread = theImage.read(b, offset, b.length-offset);

p. 276, paragraph 3: Change "The request above contains two name-value pairs, separated by ampersands." to "The request above contains two name-value pairs, separated by an ampersand."

p. 278: In Example 10-16 delete the line int cl = query.length();

p. 293: change "The createURLStreamHandler() method of the createURLStreamHandlerFactory interface" to "The createURLStreamHandler() method of the URLStreamHandlerFactory interface"


[ Java Network Programming Corrections | Java Network Programming Home Page | Table of Contents | Examples | Order from Amazon ] ]

Copyright 1998, 1999, 2003 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified January 5, 2003