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

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


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


    @Test
    public void testMultiBufferOnBoundaryAfterBufferShouldIgnoreBytesBeforeStartAndAfterLimit()
            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, 31);
        for (int i = 0; i < 8; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(31, sink.position());
        sink.flip();
        for (int i = 0; i < 31; i++) {
View Full Code Here

    @Test
    public void testMultiBufferBeforeBoundaryAfterBufferShouldIgnoreBytesBeforeStartAndAfterLimit()
            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, 31);
        for (int i = 0; i < 8; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(31, sink.position());
        sink.flip();
        for (int i = 9; i < 40; i++) {
View Full Code Here

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

    @Test
    public void testMultiBufferOnBoundaryBeforeBufferShouldIgnoreBytesBeforeStartAndAfterLimit()
            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, 29);
        for (int i = 0; i < 8; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(29, sink.position());
        sink.flip();
        for (int i = 0; i < 29; i++) {
View Full Code Here

    @Test
    public void testMultiBufferBeforeBoundaryBeforeBufferShouldIgnoreBytesBeforeStartAndAfterLimit()
            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, 29);
        for (int i = 0; i < 8; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(29, sink.position());
        sink.flip();
        for (int i = 9; i < 38; i++) {
View Full Code Here

    @Test
    public void testMultiBufferAfterBoundaryBeforeBufferShouldIgnoreBytesBeforeStartAndAfterLimit()
            throws Exception {
        byte[] bytes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        ByteBuffer src = ByteBuffer.wrap(bytes);
        PartialWritableByteChannel channel = new PartialWritableByteChannel(
                this, 31, 29);
        for (int i = 0; i < 8; i++) {
            assertEquals(10, channel.write(src));
            src.rewind();
        }
        assertEquals(29, sink.position());
        sink.flip();
        for (int i = 1; i < 30; 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.