Examples of skip()


Examples of java.util.zip.CheckedInputStream.skip()

        // testing that the return by skip is valid
        InputStream checkInput = Support_Resources.getStream("hyts_checkInput.txt");
        CheckedInputStream checkIn = new CheckedInputStream(checkInput, new CRC32());
        long skipValue = 5;
        assertEquals("the value returned by skip(n) is not the same as its parameter",
                skipValue, checkIn.skip(skipValue));
        checkIn.skip(skipValue);
        // ran JDK and found the checkSum value is 2235765342
        // System.out.print(checkIn.getChecksum().getValue());
        assertEquals("checkSum value is not correct", 2235765342L, checkIn.getChecksum()
                .getValue());
View Full Code Here

Examples of java.util.zip.DeflaterInputStream.skip()

     */
    public void testSkip() throws IOException {
        byte[] buf = new byte[1024];
        DeflaterInputStream dis = new DeflaterInputStream(is);
        assertEquals(1, dis.available());
        dis.skip(1);
        assertEquals(1, dis.available());
        assertEquals(22, dis.read(buf, 0, 1024));
        assertEquals(1, dis.available());
        dis.skip(1);
        assertEquals(0, dis.available());
View Full Code Here

Examples of java.util.zip.InflaterInputStream.skip()

    public void testAvailableSkip() throws Exception {
        // this byte[] is a deflation of these bytes: { 1, 3, 4, 6 }
        byte[] deflated = { 72, -119, 99, 100, 102, 97, 3, 0, 0, 31, 0, 15, 0 };
        InputStream in = new InflaterInputStream(new ByteArrayInputStream(deflated));
        assertEquals(1, in.available());
        assertEquals(4, in.skip(4));
        assertEquals(0, in.available());
    }

    public void testAvailableEmptySource() throws Exception {
        // this byte[] is a deflation of the empty file
View Full Code Here

Examples of java.util.zip.ZipInputStream.skip()

                if (entry.getName().equals(entryName)) {
                    result = entry.getSize();
                    if (result == -1) {
                        result = 0;
                        while (true) {
                            long x = file.skip(16 * Constants.IO_BUFFER_SIZE);
                            if (x == 0) {
                                break;
                            }
                            result += x;
                        }
View Full Code Here

Examples of javax.jcr.NodeIterator.skip()

        if (count > 1) {
            // re-execute the query
            rs = execute(query, Query.XPATH);
            it = rs.getNodes();
            // skip all but one
            it.skip(count - 1);
            // get last one
            it.nextNode();
            try {
                it.nextNode();
                fail("nextNode() must throw a NoSuchElementException when no nodes are available");
View Full Code Here

Examples of javax.jcr.PropertyIterator.skip()

                                           RepositoryFilter filter) throws RepositoryException {
        int rows = 0;
        List<AssetItem> results = new ArrayList<AssetItem>();

        PropertyIterator it = n.getReferences();
        if ( skip > 0 ) it.skip( skip );

        while ( it.hasNext() && (numRowsToReturn == -1 || rows < numRowsToReturn) ) {

            Property ruleLink = (Property) it.next();
View Full Code Here

Examples of javax.jcr.RangeIterator.skip()

        assertEquals(0, iterator.getPosition());
        assertTrue(iterator.hasNext());
        assertEquals("x", iterator.next());

        iterator.skip(1);

        assertEquals(2, iterator.getPosition());
        assertTrue(iterator.hasNext());
        assertEquals("z", iterator.next());
View Full Code Here

Examples of javax.jcr.observation.EventIterator.skip()

        testRootNode.save();
        removeEventListener(listener);
        EventIterator events = listener.getEventIterator(DEFAULT_WAIT_TIMEOUT);
        assertNotNull("No events delivered within " + DEFAULT_WAIT_TIMEOUT + "ms.", events);
        // skip zero elements
        events.skip(0);
        assertEquals("getPosition() for first element must return 0.", 0, events.getPosition());
        // skip one element
        events.skip(2);
        assertEquals("Wrong value for getPosition()", 2, events.getPosition());
        // skip past end
View Full Code Here

Examples of javax.jcr.query.RowIterator.skip()

            if (filter != null) {
                nodes = new FilteredRowIterator(nodes);
            }
            if (offset > 0) {
                try {
                    nodes.skip(offset);
                } catch (NoSuchElementException e) {
                    return RowIteratorAdapter.EMPTY;
                }
            }
            if (numResults == Integer.MAX_VALUE) {
View Full Code Here

Examples of javax.jcr.security.AccessControlPolicyIterator.skip()

        checkCanReadAc(path);
        AccessControlPolicyIterator it = acMgr.getApplicablePolicies(path);

        long size = it.getSize();
        if (size > -1) {
            it.skip(size);
            assertFalse("After skipping all elements 'hasNext()' must return false", it.hasNext());

            try {
                it.nextAccessControlPolicy();
                fail("After skipping all 'nextAccessControlPolicy()' must fail.");
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.