Examples of BufferInfo


Examples of org.apache.http.io.BufferInfo

    }

    @Test
    public void testBufferInfo() throws Exception {
        SimpleOutputBuffer buffer = new SimpleOutputBuffer(8, DirectByteBufferAllocator.INSTANCE);
        BufferInfo bufferinfo = buffer;

        Assert.assertEquals(0, bufferinfo.length());
        Assert.assertEquals(8, bufferinfo.available());
        buffer.write(new byte[] {'1', '2', '3', '4'});
        Assert.assertEquals(4, bufferinfo.length());
        Assert.assertEquals(4, bufferinfo.available());
        buffer.write(new byte[] {'1', '2', '3', '4', '5', '6', '7', '8'});
        Assert.assertEquals(12, bufferinfo.length());
        Assert.assertEquals(0, bufferinfo.available());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.