Package org.apache.james.imap.processor.fetch

Examples of org.apache.james.imap.processor.fetch.PartialWritableByteChannel


    @Test
    public void testMultiBufferBeforeBoundaryOctetsOverBufferShouldIgnoreBytesBeforeStart()
            throws Exception {
        byte[] bytes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        ByteBuffer src = ByteBuffer.wrap(bytes);
        PartialWritableByteChannel channel = new PartialWritableByteChannel(
                this, 19, 21);
        for (int i = 0; i < 5; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(21, sink.position());
        sink.flip();
        for (int l = 0; l < 2; l++) {
View Full Code Here


    @Test
    public void testMultiBufferOnBoundaryOctetsOnBufferShouldIgnoreBytesBeforeStart()
            throws Exception {
        byte[] bytes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        ByteBuffer src = ByteBuffer.wrap(bytes);
        PartialWritableByteChannel channel = new PartialWritableByteChannel(
                this, 20, 20);
        for (int i = 0; i < 5; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(20, sink.position());
        sink.flip();
        for (int l = 0; l < 2; l++) {
View Full Code Here

    @Test
    public void testMultiBufferAfterBoundaryOctetsObBufferShouldIgnoreBytesBeforeStart()
            throws Exception {
        byte[] bytes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        ByteBuffer src = ByteBuffer.wrap(bytes);
        PartialWritableByteChannel channel = new PartialWritableByteChannel(
                this, 21, 20);
        for (int i = 0; i < 5; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(20, sink.position());
        sink.flip();
        for (int l = 0; l < 2; l++) {
View Full Code Here

    @Test
    public void testMultiBufferBeforeBoundaryOctetsOnBufferShouldIgnoreBytesBeforeStart()
            throws Exception {
        byte[] bytes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        ByteBuffer src = ByteBuffer.wrap(bytes);
        PartialWritableByteChannel channel = new PartialWritableByteChannel(
                this, 19, 20);
        for (int i = 0; i < 5; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(20, sink.position());
        sink.flip();
        for (int l = 0; l < 2; l++) {
View Full Code Here

    @Test
    public void testMultiBufferOnBoundaryOctetsUnderBufferShouldIgnoreBytesBeforeStart()
            throws Exception {
        byte[] bytes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        ByteBuffer src = ByteBuffer.wrap(bytes);
        PartialWritableByteChannel channel = new PartialWritableByteChannel(
                this, 20, 19);
        for (int i = 0; i < 5; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(19, sink.position());
        sink.flip();
        for (int l = 0; l < 2; l++) {
View Full Code Here

    @Test
    public void testMultiBufferAfterBoundaryOctetsUnderBufferShouldIgnoreBytesBeforeStart()
            throws Exception {
        byte[] bytes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        ByteBuffer src = ByteBuffer.wrap(bytes);
        PartialWritableByteChannel channel = new PartialWritableByteChannel(
                this, 21, 19);
        for (int i = 0; i < 5; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(19, sink.position());
        sink.flip();
        for (int l = 0; l < 2; l++) {
View Full Code Here

    @Test
    public void testMultiBufferBeforeBoundaryOctetsUnderBufferShouldIgnoreBytesBeforeStart()
            throws Exception {
        byte[] bytes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        ByteBuffer src = ByteBuffer.wrap(bytes);
        PartialWritableByteChannel channel = new PartialWritableByteChannel(
                this, 19, 19);
        for (int i = 0; i < 5; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(19, sink.position());
        sink.flip();
        for (int l = 0; l < 2; l++) {
View Full Code Here

    @Test
    public void testMultiBufferShouldIgnoreBytesBeforeStartAndAfterLimit()
            throws Exception {
        byte[] bytes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        ByteBuffer src = ByteBuffer.wrap(bytes);
        PartialWritableByteChannel channel = new PartialWritableByteChannel(
                this, 4, 2);
        assertEquals(10, channel.write(src));
        assertEquals(2, sink.position());
        sink.flip();
        for (int i = 4; i < 6; i++) {
            assertEquals(i, sink.get());
        }
View Full Code Here

    @Test
    public void testMultiBufferOnBoundaryOnBufferShouldIgnoreBytesBeforeStartAndAfterLimit()
            throws Exception {
        byte[] bytes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        ByteBuffer src = ByteBuffer.wrap(bytes);
        PartialWritableByteChannel channel = new PartialWritableByteChannel(
                this, 30, 30);
        for (int i = 0; i < 8; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(30, sink.position());
        sink.flip();
        for (int i = 0; i < 30; i++) {
View Full Code Here

    @Test
    public void testMultiBufferBeforeBoundaryOnBufferShouldIgnoreBytesBeforeStartAndAfterLimit()
            throws Exception {
        byte[] bytes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        ByteBuffer src = ByteBuffer.wrap(bytes);
        PartialWritableByteChannel channel = new PartialWritableByteChannel(
                this, 29, 30);
        for (int i = 0; i < 8; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(30, sink.position());
        sink.flip();
        for (int i = 9; i < 39; i++) {
View Full Code Here

TOP

Related Classes of org.apache.james.imap.processor.fetch.PartialWritableByteChannel

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.