Inputstream from runtime exec does not meet end of stream-Collection of common programming errors

I use Java 1.6.0_24 in Linux.

I execute program using runtime exec in Java.

and I read standard out from its inputstream as following.

BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
while(in.readline() != null) {
// handle standard output
}

However, in.readline never meets end of stream and it hangs there forever after reading all the outputs. It happens even if process is terminated. Also, that process makes daemon process by fork and exec. When I kill daemon process by force, in.readline meets end of stream.

Please let me know why this happens and good idea to meet end of stream without killing the daemon process.