Java NIO by Ron Hitchens The unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification This page was updated February 27, 2008. UNCONFIRMED errors and comments from readers: {21} 1st code example + penultimate normal paragraph; The code example for (int i = 0; buffer.hasRemaining(), i++) { myByteArray [i] = buffer.get() } is claimed to be inefficient but thread-safe. Actually it isn't thread-safe because another thread could call get() between the hasRemaining() and get() call, so the hasRemaining() test doesn't guarantee that get() won't throw a BufferUnderflowException. {26} 4th pargraph (1st paragraph after figure2-10); description of compareTo()'s behavior is incorrect. Book says: "returns an integer that is negative, zero, or positive if the buffer argument is less than, equal to, or greater than, respectively, the object instance on which compareTo() was invoked." JavaDoc for compareTo(): Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. (93) Class ServerSocketChannel; method accept() returns SocketChannel, not ServerChannel. (93) Class SocketChannel; Both open() methods return SocketChannel, not ServerSocketChannel. (96) API of ServerSocketChannel; The return type of accept() should be SocketChannel. {140-141} Listing Sample (4-1); the sample code references a non instantiated "buffer" object {141} sayHello() method; in registerChannel() method, if( channel == null ) was checked. Samething could happen here. You may get a NullException when calling channel.write( buffer ). (160) Table 5-2; the column regex="d" is incorrect from row limit=5 through row limit=0 the column should only have two "tokens" as follows "poo", "le zoo" for each of those columns (the columns each have three tokens AND the z is missing) ... [208] 2nd Paragraph and CoderResult API; The text and the API state that CoderResult uses the type-safe enumeration pattern. This is not the case, the statics on the CoderResult object are private and ints. This also means that example 6-2 is incorrect