public static final boolean endsWithDelimiter(byte[] bytes, int endPos, byte[] delim) {
        if (endPos < delim.length - 1) {
            return false;
        }
        for (int pos = 0; pos < delim.length; ++pos) {
            if (delim[pos] != bytes[endPos - delim.length + 1 + pos]) {
                return false;
            }
        }
        return true;
    }
@Test
    void testEndsWithDelimiter() {
        byte[] bytes = "aabc".getBytes();
        byte[] delim = "ab".getBytes();
        assertThat(FieldParser.endsWithDelimiter(bytes, 0, delim)).isFalse();
        assertThat(FieldParser.endsWithDelimiter(bytes, 1, delim)).isFalse();
        assertThat(FieldParser.endsWithDelimiter(bytes, 2, delim)).isTrue();
        assertThat(FieldParser.endsWithDelimiter(bytes, 3, delim)).isFalse();
    }