@Test(expected=ConnectionClosedException.class)
public void testTruncatedContent() throws Exception {

    final ReadableByteChannel channel = new ReadableByteChannelMock(
            new String[] {"1234567890"}, StandardCharsets.US_ASCII);
    final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, 0, StandardCharsets.US_ASCII);
    final BasicHttpTransportMetrics metrics = new BasicHttpTransportMetrics();
    final LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
            channel, inbuf, metrics, 20);
    final ByteBuffer dst = ByteBuffer.allocate(1024);
    final int bytesRead = decoder.read(dst);
    Assert.assertEquals(10, bytesRead);
    decoder.read(dst);
}