String header = con.readStringByDelimiter("\r\n\r\n") + "\r\n";
Assert.assertTrue(header.indexOf("200") != -1);
Assert.assertTrue(header.indexOf("Connection: close") != -1);
Assert.assertEquals("<html>this ...", con.readStringByLength(14));
try {
con.readByte();
Assert.fail("ClosedChannelException expected");
} catch (ClosedChannelException expected) { }