/** * Find the nth occurrence of the given byte b in a UTF-8 encoded string * @param utf a byte array containing a UTF-8 encoded string * @param b the byte to find * @param n the desired occurrence of the given byte * @return position that nth occurrence of the given byte if exists; otherwise -1 */ public static int findNthByte(byte [] utf, byte b, int n) { return findNthByte(utf, 0, utf.length, b, n); }
/** * Find the nth occurrence of the given byte b in a UTF-8 encoded string * @param utf a byte array containing a UTF-8 encoded string * @param b the byte to find * @param n the desired occurrence of the given byte * @return position that nth occurrence of the given byte if exists; otherwise -1 */ public static int findNthByte(byte [] utf, byte b, int n) { return findNthByte(utf, 0, utf.length, b, n); }
/** * Find the first occurred tab in a UTF-8 encoded string * @param utf a byte array containing a UTF-8 encoded string * @return position that first tab occurres otherwise -1 */ public static int findTab(byte [] utf) { return org.apache.hadoop.util.UTF8ByteArrayUtils.findNthByte(utf, 0, utf.length, (byte)'\t', 1); }
/** * Find the nth occurrence of the given byte b in a UTF-8 encoded string * @param utf a byte array containing a UTF-8 encoded string * @param b the byte to find * @param n the desired occurrence of the given byte * @return position that nth occurrence of the given byte if exists; otherwise -1 */ public static int findNthByte(byte [] utf, byte b, int n) { return findNthByte(utf, 0, utf.length, b, n); }
/** * Find the nth occurrence of the given byte b in a UTF-8 encoded string * @param utf a byte array containing a UTF-8 encoded string * @param b the byte to find * @param n the desired occurrence of the given byte * @return position that nth occurrence of the given byte if exists; otherwise -1 */ public static int findNthByte(byte [] utf, byte b, int n) { return findNthByte(utf, 0, utf.length, b, n); }
/** * Find the first occured tab in a UTF-8 encoded string * @param utf a byte array containing a UTF-8 encoded string * @return position that first tab occures otherwise -1 */ public static int findTab(byte [] utf) { return org.apache.hadoop.util.UTF8ByteArrayUtils.findNthByte(utf, 0, utf.length, (byte)'\t', 1); }
/** * Find the nth occurrence of the given byte b in a UTF-8 encoded string * @param utf a byte array containing a UTF-8 encoded string * @param b the byte to find * @param n the desired occurrence of the given byte * @return position that nth occurrence of the given byte if exists; otherwise -1 */ public static int findNthByte(byte [] utf, byte b, int n) { return findNthByte(utf, 0, utf.length, b, n); }
/** * Find the nth occurrence of the given byte b in a UTF-8 encoded string * @param utf a byte array containing a UTF-8 encoded string * @param b the byte to find * @param n the desired occurrence of the given byte * @return position that nth occurrence of the given byte if exists; otherwise -1 */ public static int findNthByte(byte [] utf, byte b, int n) { return findNthByte(utf, 0, utf.length, b, n); }
/** * Find the nth occurrence of the given byte b in a UTF-8 encoded string * @param utf a byte array containing a UTF-8 encoded string * @param b the byte to find * @param n the desired occurrence of the given byte * @return position that nth occurrence of the given byte if exists; otherwise -1 */ public static int findNthByte(byte [] utf, byte b, int n) { return findNthByte(utf, 0, utf.length, b, n); }