Examples of skip()


Examples of org.apache.hadoop.hive.ql.udf.xml.UDFXPathUtil.ReusableStringReader.skip()

  public void testSkip() throws IOException {
    Reader reader = new ReusableStringReader();
   
    ((ReusableStringReader)reader).set(fox);
    // skip entire the data:
    long skipped = reader.skip(fox.length() + 1);
    assertEquals(fox.length(), skipped)
    assertEquals(-1, reader.read());
   
    ((ReusableStringReader)reader).set(fox); // reset the data
    char[] cc = new char[6];
View Full Code Here

Examples of org.apache.http.impl.io.ContentLengthInputStream.skip()

        assertEquals(result, "1234567890");
    }

    public void testSkip() throws IOException {
        InputStream in = new ContentLengthInputStream(new SessionInputBufferMockup(new byte[20]), 10L);
        assertEquals(10, in.skip(10));
        assertTrue(in.read() == -1);

        in = new ContentLengthInputStream(new SessionInputBufferMockup(new byte[20]), 10L);
        in.read();
        assertEquals(9, in.skip(10));
View Full Code Here

Examples of org.apache.jackrabbit.ocm.manager.impl.ObjectIterator.skip()

              assertEquals("wrong results count", 4, iterator.getSize());
              assertEquals("wrong initial position", 0, iterator.getPosition());
              assertTrue("no objects returned", iterator.hasNext());
              Page page = (Page) iterator.next();
              assertEquals("wrong first result", "Page 1 Title", page.getTitle());
              iterator.skip(1);
              assertEquals("wrong position after skip", 2, iterator.getPosition());
              page = (Page) iterator.next();
              assertEquals("wrong third result", "Page 3 Title", page.getTitle());
        }
        catch (Exception e)
View Full Code Here

Examples of org.apache.kahadb.util.DataByteArrayOutputStream.skip()

                ByteSequence sequence = buff.toByteSequence();

                // Now we can fill in the batch control record properly.
                buff.reset();
                buff.skip(5+Journal.BATCH_CONTROL_RECORD_MAGIC.length);
                buff.writeInt(sequence.getLength()-Journal.BATCH_CONTROL_RECORD_SIZE);
                if( journal.isChecksum() ) {
                    Checksum checksum = new Adler32();
                    checksum.update(sequence.getData(), sequence.getOffset()+Journal.BATCH_CONTROL_RECORD_SIZE, sequence.getLength()-Journal.BATCH_CONTROL_RECORD_SIZE);
                    buff.writeLong(checksum.getValue());
View Full Code Here

Examples of org.apache.lucene.analysis.CharFilter.skip()

    } catch (Exception e) {
      assertEquals("reset()", e.getMessage());
    }
   
    try {
      cs.skip(1);
      fail();
    } catch (Exception e) {
      assertEquals("skip(long)", e.getMessage());
    }
   
View Full Code Here

Examples of org.apache.lucene.analysis.CharStream.skip()

    } catch (Exception e) {
      assertEquals("reset()", e.getMessage());
    }
   
    try {
      cs.skip(1);
      fail();
    } catch (Exception e) {
      assertEquals("skip(long)", e.getMessage());
    }
   
View Full Code Here

Examples of org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator.skip()

    DataModel dataModel = getDataModel();
    int numItems = dataModel.getNumItems();
    List<RecommendedItem> result = new ArrayList<RecommendedItem>(howMany);
    while (result.size() < howMany) {
      LongPrimitiveIterator it = dataModel.getItemIDs();
      it.skip(random.nextInt(numItems));
      long itemID = it.next();
      if (dataModel.getPreferenceValue(userID, itemID) == null) {
        result.add(new GenericRecommendedItem(itemID, randomPref()));
      }
    }
View Full Code Here

Examples of org.apache.mina.common.ByteBuffer.skip()

        try
        {
            if ((_propertyFlags & (CONTENT_TYPE_MASK)) != 0)
            {
                byte length = buffer.get();
                buffer.skip(length);
            }

            if ((_propertyFlags & ENCONDING_MASK) != 0)
            {
                byte length = buffer.get();
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.skip()

                            break;
                        case READING:
                            int remaining = buffer.remaining();
                            if (length > remaining) {
                                length -= remaining;
                                buffer.skip(remaining);
                            } else {
                                buffer.skip(length);
                                session.write(ACK.slice());
                                state = State.WAIT_FOR_FIRST_BYTE_LENGTH;
                                length = 0;
View Full Code Here

Examples of org.apache.olingo.odata2.jpa.processor.core.access.data.JPAPage.JPAPageBuilder.skip()

        .entities(result)
        .skipToken(uriParserResultView.getSkipToken());

    // $top/$skip with $inlinecount case handled in response builder to avoid multiple DB call
    if (uriParserResultView.getSkip() != null && uriParserResultView.getInlineCount() == null) {
      pageBuilder.skip(uriParserResultView.getSkip().intValue());
    }

    if (uriParserResultView.getTop() != null && uriParserResultView.getInlineCount() == null) {
      pageBuilder.top(uriParserResultView.getTop().intValue());
    }
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.