I'm currently setting up some unit tests for our NetBurner code using a Java based connection. I have this piece of code, that I'd like to test a failure on.
I'm not just trying to be pedantic but what you are proposing is not a unit test, it is more of an integration test. If you are trying to satisfy a unit testing coverage requirement you will probably need to insert a testing seam into the code. If you don't care about the distinction, then one way to force read to fail would be to use an invalid file descriptor for fd_Network. The error returned should be TCP_ERR_NOSUCH_SOCKET which is -4.
Without capturing the return value of writeall() it might be tough to write a good test.