Package org.apache.hadoop.hive.ql.udf.xml.UDFXPathUtil

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


    read = reader.read(cc);
    assertEquals(6, read);
    assertEquals("Quick ", new String(cc));
   
    // skip some piece of data:
    skipped = reader.skip(30);
    assertEquals(30, skipped);
    read = reader.read(cc);
    assertEquals(4, read);
    assertEquals("dog.", new String(cc, 0, read));
View Full Code Here

    read = reader.read(cc);
    assertEquals(4, read);
    assertEquals("dog.", new String(cc, 0, read));

    // skip when already at EOF:
    skipped = reader.skip(300);
    assertEquals(0, skipped)
    assertEquals(-1, reader.read());
   
    reader.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.