Java examples for java.nio:CharBuffer
CharBuffer match Up To Char
//package com.java2s; import java.nio.CharBuffer; public class Main { public static int matchUpToChar(CharBuffer buf, int fromInc, int limit, char target) { for (int i = fromInc; i < limit; i++) { char c = buf.get(i); if (c == target) { return i; }//from w w w .j av a2 s . c o m } return -1; } }