nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From PuspenduBanerjee <>
Subject [GitHub] nifi pull request: NIFI-924:Nifi-Camel Integration
Date Mon, 01 Feb 2016 23:28:29 GMT
Github user PuspenduBanerjee commented on the pull request:
    @joewitt For Non-Uniform charset attached piece should work.
         * @param rawBytes
         * @param patternToMatch
         * @return
        private static boolean matchPattern(byte[] rawBytes , final String patternToMatch){
            out.println("Pattern= "+patternToMatch);
            final Pattern pattern = Pattern.compile(patternToMatch);
            final int patternByteLength=patternToMatch.getBytes().length;
            out.println("PatternByteLength= "+patternByteLength); 
            final int minSliceByteLength=2;
            final int sliceByteLength = patternByteLength > minSliceByteLength ? patternByteLength
: minSliceByteLength;
            int offset = 0;
            while (offset <= rawBytes.length) {
                String s=new String(Arrays.copyOfRange(rawBytes, offset>patternByteLength?
                                                       (offset + sliceByteLength)));
                out.println("Retrieved byte[]= "+s);
                if (pattern.matcher(s).find()) {
                    return true;
                offset += sliceByteLength;
            return false;
    I tried with \:

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message