Package org.apache.http.io

Examples of org.apache.http.io.BufferInfo.available()


    public void testBufferInfo() throws Exception {
        final SimpleOutputBuffer buffer = new SimpleOutputBuffer(8, DirectByteBufferAllocator.INSTANCE);
        final 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());
View Full Code Here


        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

        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());
    }

    @Test
    public void testInputBufferNullInput() throws IOException {
        final SimpleInputBuffer buffer = new SimpleInputBuffer(4, DirectByteBufferAllocator.INSTANCE);
View Full Code Here

    public void testBufferInfo() throws Exception {
        SimpleOutputBuffer buffer = new SimpleOutputBuffer(8, new DirectByteBufferAllocator());
        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());
View Full Code Here

        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

        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());
    }

    @Test
    public void testInputBufferNullInput() throws IOException {
        SimpleInputBuffer buffer = new SimpleInputBuffer(4, new DirectByteBufferAllocator());
View Full Code Here

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

        assertEquals(0, bufferinfo.length());
        assertEquals(8, bufferinfo.available());
        buffer.write(new byte[] {'1', '2', '3', '4'});
        assertEquals(4, bufferinfo.length());
        assertEquals(4, bufferinfo.available());
        buffer.write(new byte[] {'1', '2', '3', '4', '5', '6', '7', '8'});
        assertEquals(12, bufferinfo.length());
View Full Code Here

        assertEquals(0, bufferinfo.length());
        assertEquals(8, bufferinfo.available());
        buffer.write(new byte[] {'1', '2', '3', '4'});
        assertEquals(4, bufferinfo.length());
        assertEquals(4, bufferinfo.available());
        buffer.write(new byte[] {'1', '2', '3', '4', '5', '6', '7', '8'});
        assertEquals(12, bufferinfo.length());
        assertEquals(0, bufferinfo.available());
    }
View Full Code Here

        buffer.write(new byte[] {'1', '2', '3', '4'});
        assertEquals(4, bufferinfo.length());
        assertEquals(4, bufferinfo.available());
        buffer.write(new byte[] {'1', '2', '3', '4', '5', '6', '7', '8'});
        assertEquals(12, bufferinfo.length());
        assertEquals(0, bufferinfo.available());
    }

    public void testInputBufferNullInput() throws IOException {
        SimpleInputBuffer buffer = new SimpleInputBuffer(4, new DirectByteBufferAllocator());
        assertEquals(0, buffer.read(null));
View Full Code Here

    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());
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.