Package com.cloudera.flume.handlers.text.CustomDelimCursor

Examples of com.cloudera.flume.handlers.text.CustomDelimCursor.ByteBufferAsCharSequence.subSequence()


  @Test
  public void testBBCSSubsequence() {
    ByteBuffer buf = ByteBuffer.wrap("This is a test".getBytes());
    ByteBufferAsCharSequence bbcs = new ByteBufferAsCharSequence(buf);

    CharSequence cs = bbcs.subSequence(5, 13);
    assertEquals('i', cs.charAt(0));
    assertEquals('s', cs.charAt(1));
    assertEquals('s', cs.charAt(7));

    // original still sane?
View Full Code Here


  @Test(expected = IndexOutOfBoundsException.class)
  public void testBBCSSubsequenceIOOBE() {
    ByteBuffer buf = ByteBuffer.wrap("This is a test".getBytes());
    ByteBufferAsCharSequence bbcs = new ByteBufferAsCharSequence(buf);

    CharSequence cs = bbcs.subSequence(5, 13);
    cs.charAt(8);
  }

  @Before
  public void setDebug() {
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.