Package org.apache.http.io

Examples of org.apache.http.io.BufferInfo


    }

    @Test
    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());
        Assert.assertEquals(0, bufferinfo.available());
    }
View Full Code Here


    }

    @Test
    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());
        Assert.assertEquals(0, bufferinfo.available());
    }
View Full Code Here

        assertEquals("stuff;more stuff", EncodingUtils.getAsciiString(content));
    }

    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());
        assertEquals(0, bufferinfo.available());
    }
View Full Code Here

    }

    @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

Related Classes of org.apache.http.io.BufferInfo

Copyright © 2018 www.massapicom. 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.