Examples of skipNextEntry()


Examples of com.fasterxml.util.membuf.ChunkyBytesMemBuffer.skipNextEntry()

    private void _testChunkyLongerSkip(SegType aType) throws Exception
    {
        final ChunkyBytesMemBuffer buffer = createBytesBuffers(aType, 10, 1, 4).createChunkyBuffer(1, 3);
        // maximum: 29 data bytes, 1 for length
        buffer.appendEntry(new byte[29]);
        assertEquals(29, buffer.skipNextEntry());
        assertEquals(-1, buffer.skipNextEntry());
    }

    /*
    /**********************************************************************
 
View Full Code Here

Examples of com.fasterxml.util.membuf.ChunkyBytesMemBuffer.skipNextEntry()

    {
        final ChunkyBytesMemBuffer buffer = createBytesBuffers(aType, 10, 1, 4).createChunkyBuffer(1, 3);
        // maximum: 29 data bytes, 1 for length
        buffer.appendEntry(new byte[29]);
        assertEquals(29, buffer.skipNextEntry());
        assertEquals(-1, buffer.skipNextEntry());
    }

    /*
    /**********************************************************************
    /* Actual test impls for streamy buffers
View Full Code Here

Examples of com.fasterxml.util.membuf.ChunkyBytesMemBuffer.skipNextEntry()

       assertFalse(buffer.isEmpty());

       // then peek, read/skip
       byte[] chunk = buffer.peekNextEntry();
       Assert.assertArrayEquals(buildBytesChunk(1), chunk);
       assertEquals(1, buffer.skipNextEntry());

       assertEquals(2, buffer.getNextEntryLength());
       chunk = buffer.peekNextEntry();
       Assert.assertArrayEquals(buildBytesChunk(2), chunk);
       assertEquals(2, buffer.getNextEntryLength());
View Full Code Here

Examples of com.fasterxml.util.membuf.ChunkyBytesMemBuffer.skipNextEntry()

       chunk = buffer.peekNextEntry();
       Assert.assertArrayEquals(buildBytesChunk(4), chunk);
       // should be idempotent
       byte[] chunk2 = buffer.peekNextEntry();
       Assert.assertArrayEquals(chunk, chunk2);
       assertEquals(4, buffer.skipNextEntry());
      
       assertEquals(5, buffer.skipNextEntry());

       chunk = buffer.peekNextEntry();
       Assert.assertArrayEquals(buildBytesChunk(6), chunk);
View Full Code Here

Examples of com.fasterxml.util.membuf.ChunkyBytesMemBuffer.skipNextEntry()

       // should be idempotent
       byte[] chunk2 = buffer.peekNextEntry();
       Assert.assertArrayEquals(chunk, chunk2);
       assertEquals(4, buffer.skipNextEntry());
      
       assertEquals(5, buffer.skipNextEntry());

       chunk = buffer.peekNextEntry();
       Assert.assertArrayEquals(buildBytesChunk(6), chunk);
       assertEquals(6, buffer.getNextEntryLength());
       byte[] buf = new byte[6];
View Full Code Here

Examples of com.fasterxml.util.membuf.ChunkyBytesMemBuffer.skipNextEntry()

       byte[] buf = new byte[6];
       assertEquals(6, buffer.readNextEntry(buf, 0));
       Assert.assertArrayEquals(chunk, buf);

       // and when empty, nothing more:
       assertEquals(-1, buffer.skipNextEntry());
       assertTrue(buffer.isEmpty());

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