Code example for HttpTransportMetricsImpl

        final String s = "5\r\n01234\r\n5\r\n56789\n\r6\r\nabcdef\r\n0\r\n\r\n";
        final ReadableByteChannel channel = new ReadableByteChannelMock(
                new String[] {s}, Consts.ASCII);
        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
        final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
        final ChunkDecoder decoder = new ChunkDecoder(channel, inbuf, metrics);
        final ByteBuffer dst = ByteBuffer.allocate(1024);
        try { 
  "MalformedChunkCodingException should have been thrown");
        } catch (final MalformedChunkCodingException ex) {
            // expected 
    public void testMalformedChunkTruncatedChunk() throws Exception { 
Experience pair programming with AI  Get Codota for Java