@Test
public void testZeroLengthDecoding() throws Exception {

    final ReadableByteChannel channel = new ReadableByteChannelMock(
            new String[] {"stuff"}, 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, 0);
    final ByteBuffer dst = ByteBuffer.allocate(1024);
    final int bytesRead = decoder.read(dst);
    Assert.assertEquals(-1, bytesRead);
    Assert.assertTrue(decoder.isCompleted());
    Assert.assertEquals(0, metrics.getBytesTransferred());
}