public List<byte[]> asTokens(byte delimiter) {
        List<byte[]> list = new ArrayList<byte[]>();
        byte[] input = asBytes();
        if (null == input || 0 == input.length) {
            return list;
        }
        byte[] token = null;
        int tokenStartPosition = 0;
        int tokenLength = 0;

        for (int i = 0; i < input.length; i++) {
            if (BNFHeaders.SPACE == input[i] || delimiter == input[i]) {
                if (0 < tokenLength) {
                    token = new byte[tokenLength];
                    System.arraycopy(input, tokenStartPosition, token, 0, tokenLength);
                    list.add(token);
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "Parsed token [" + GenericUtils.getEnglishString(token) + "]");
                    }
                }
                tokenLength = 0;
                // To account for the delimiter
                tokenStartPosition = i + 1;
            } else {
                tokenLength++;
            }
        }

        // Last token
        if (0 < tokenLength) {
            token = new byte[tokenLength];
            System.arraycopy(input, tokenStartPosition, token, 0, tokenLength);
            list.add(token);
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Parsed token [" + GenericUtils.getEnglishString(token) + "]");
            }
        }

        return list;
    }
public List < byte [ ] > asTokens ( byte delimiter ) { List < byte [ ] > list = new ArrayList < byte [ ] > ( ) ; byte [ ] input = asBytes ( ) ; if ( null == input || 0 == input . length ) { return list ; } byte [ ] token = null ; int tokenStartPosition = 0 ; int tokenLength = 0 ; for ( int i = 0 ; i < input . length ; i ++ ) { if ( BNFHeaders . SPACE == input [ i ] || delimiter == input [ i ] ) { if ( 0 < tokenLength ) { token = new byte [ tokenLength ] ; System . arraycopy ( input , tokenStartPosition , token , 0 , tokenLength ) ; list . add ( token ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Parsed token [" + GenericUtils . getEnglishString ( token ) + "]" ) ; } } tokenLength = 0 ; tokenStartPosition = i + 1 ; } else { tokenLength ++ ; } } if ( 0 < tokenLength ) { token = new byte [ tokenLength ] ; System . arraycopy ( input , tokenStartPosition , token , 0 , tokenLength ) ; list . add ( token ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Parsed token [" + GenericUtils . getEnglishString ( token ) + "]" ) ; } } return list ; }
@see HeaderField#asTokens(byte)