Oh - and in the test I don't know if its necessary to do the NoCloseOutputStream wrapper when using the byte buffer output streams - we want the streams closed when the connection is closed here (although you wouldn't want that if you were writing to system.out, obviously.)