/** * Check if a text is present at the current position in a buffer. * * @param chars The buffer which contains the data * @param index Current position in the buffer * @param chars2 The text we want to check * @return <code>true</code> if the buffer contains the text. */ public static int areEquals( char[] chars, int index, char[] chars2 ) { return areEquals( chars, index, chars2, true ); }
/** * Check if a text is present at the current position in a buffer. * * @param chars The buffer which contains the data * @param index Current position in the buffer * @param text The text we want to check * @return <code>true</code> if the buffer contains the text. */ public static int areEquals( char[] chars, int index, String text ) { return areEquals( chars, index, text, true ); }
/** * Check if a text is present at the current position in a buffer. * * @param chars The buffer which contains the data * @param index Current position in the buffer * @param text The text we want to check * @return <code>true</code> if the buffer contains the text. */ public static int areEquals( char[] chars, int index, String text ) { return areEquals( chars, index, text, true ); }
/** * Check if a text is present at the current position in a buffer. * * @param chars The buffer which contains the data * @param index Current position in the buffer * @param chars2 The text we want to check * @return <code>true</code> if the buffer contains the text. */ public static int areEquals( char[] chars, int index, char[] chars2 ) { return areEquals( chars, index, chars2, true ); }
/** * Check if a text is present at the current position in a buffer. * * @param bytes The buffer which contains the data * @param index Current position in the buffer * @param text The text we want to check * @return <code>true</code> if the buffer contains the text. */ public static int areEquals( byte[] bytes, int index, String text ) { if ( ( bytes == null ) || ( bytes.length == 0 ) || ( bytes.length <= index ) || ( index < 0 ) || ( text == null ) ) { return StringConstants.NOT_EQUAL; } else { byte[] data = text.getBytes( StandardCharsets.UTF_8 ); return areEquals( bytes, index, data ); } }
/** * Check if a text is present at the current position in a buffer. * * @param chars The buffer which contains the data * @param index Current position in the buffer * @param text The text we want to check * @param caseSensitive If the comparison is case-sensitive * @return <code>true</code> if the buffer contains the text. */ public static int areEquals( char[] chars, int index, String text, boolean caseSensitive ) { if ( ( chars == null ) || ( chars.length == 0 ) || ( chars.length <= index ) || ( index < 0 ) || ( text == null ) ) { return StringConstants.NOT_EQUAL; } else { char[] data = text.toCharArray(); return areEquals( chars, index, data, caseSensitive ); } }
/** * Check if a text is present at the current position in a buffer. * * @param bytes The buffer which contains the data * @param index Current position in the buffer * @param text The text we want to check * @return <code>true</code> if the buffer contains the text. */ public static int areEquals( byte[] bytes, int index, String text ) { if ( ( bytes == null ) || ( bytes.length == 0 ) || ( bytes.length <= index ) || ( index < 0 ) || ( text == null ) ) { return StringConstants.NOT_EQUAL; } else { byte[] data = text.getBytes( StandardCharsets.UTF_8 ); return areEquals( bytes, index, data ); } }
/** * Check if a text is present at the current position in a buffer. * * @param chars The buffer which contains the data * @param index Current position in the buffer * @param text The text we want to check * @param caseSensitive If the comparison is case-sensitive * @return <code>true</code> if the buffer contains the text. */ public static int areEquals( char[] chars, int index, String text, boolean caseSensitive ) { if ( ( chars == null ) || ( chars.length == 0 ) || ( chars.length <= index ) || ( index < 0 ) || ( text == null ) ) { return StringConstants.NOT_EQUAL; } else { char[] data = text.toCharArray(); return areEquals( chars, index, data, caseSensitive ); } }