private void saveParsedToken ( WsByteBuffer buff , int start , boolean delim , int log ) { final boolean bTrace = TraceComponent . isAnyTracingEnabled ( ) ; // local copy of the length int length = this . parsedTokenLength ; this . parsedTokenLength = 0 ; if ( 0 > length ) { throw new IllegalArgumentException ( "Negative token length: " + length ) ; } if ( bTrace && tc . isDebugEnabled ( ) ) { // 295178 - don't log sensitive information String value = GenericUtils . getEnglishString ( this . parsedToken ) ; if ( null != value ) { if ( LOG_PARTIAL == log ) { value = GenericUtils . nullOutPasswords ( value , LF ) ; } else if ( LOG_NONE == log ) { value = GenericUtils . blockContents ( value ) ; } } Tr . debug ( tc , "Saving token: " + value + " len:" + length + " start:" + start + " pos:" + this . bytePosition + " delim:" + delim ) ; } byte [ ] temp ; int offset ; if ( null != this . parsedToken ) { // concat to the existing value offset = this . parsedToken . length ; temp = new byte [ offset + length ] ; System . arraycopy ( this . parsedToken , 0 , temp , 0 , offset ) ; } else { offset = 0 ; temp = new byte [ length ] ; } //PI13987 - Added the first argument if ( ! this . foundTrailingWhitespace && this . bytePosition > length ) { // pull from the bytecache if ( bTrace && tc . isDebugEnabled ( ) ) { //PI13987 - Print out this new trace message Tr . debug ( tc , "savedParsedToken - using bytecache" ) ; } int cacheStart = this . bytePosition - length ; if ( delim ) { cacheStart -- ; } System . arraycopy ( this . byteCache , cacheStart , temp , offset , length ) ; } else { // must pull from the buffer if ( bTrace && tc . isDebugEnabled ( ) ) { //PI13987 - Print this new trace message Tr . debug ( tc , "savedParsedToken - pulling from buffer" ) ; } int orig = buff . position ( ) ; buff . position ( start ) ; buff . get ( temp , offset , length ) ; buff . position ( orig ) ; } this . parsedToken = temp ; if ( bTrace && tc . isDebugEnabled ( ) ) { // 295178 - don't log sensitive information String value = GenericUtils . getEnglishString ( this . parsedToken ) ; if ( LOG_PARTIAL == log ) { value = GenericUtils . nullOutPasswords ( value , LF ) ; } else if ( LOG_NONE == log ) { value = GenericUtils . blockContents ( value ) ; } Tr . debug ( tc , "Saved token [" + value + "]" ) ; } }
Sets the temporary parse token from the input buffer .