How does InputStreamReader.close() work internally?

So every time I source dive Sun Oracle's Java code I am disappointed. nd as a variable name? Does not get more opaque than that.

What nd is referencing is NativeDispatcher which handles platform specific operations, such as closing File Descriptors (kindly named the variable fd). I can only assume the NativeThread check and signal is to clean up the read/write threads, the source does not lend much information. The isRegistered() from AbstractSelectableChannel makes sure the Channel is not being used and the kill method is what closes everything down and finally calls the nd.close(fd);

Tags:

Java

File Io