/** * Returns true if the message bytes starts with the specified string. * @param c the character * @param starting The start position */ public int indexOf(char c, int starting) { int ret = indexOf( buff, start+starting, end, c); return (ret >= start) ? ret - start : -1; }
/** * Returns true if the message bytes starts with the specified string. * @param c the character * @param starting The start position */ public int indexOf(char c, int starting) { int ret = indexOf( buff, start+starting, end, c); return (ret >= start) ? ret - start : -1; }
/** * Returns true if the message bytes starts with the specified string. * @param c the character * @param starting The start position */ public int indexOf(char c, int starting) { int ret = indexOf( buff, start+starting, end, c); return (ret >= start) ? ret - start : -1; }
/** * Returns the first instance of the given character in this ByteChunk * starting at the specified byte. If the character is not found, -1 is * returned. <br> * NOTE: This only works for characters in the range 0-127. * * @param c The character * @param starting The start position * @return The position of the first instance of the character or -1 if the * character is not found. */ public int indexOf(char c, int starting) { int ret = indexOf(buff, start + starting, end, c); return (ret >= start) ? ret - start : -1; }
/** * Returns the first instance of the given character in this ByteChunk * starting at the specified byte. If the character is not found, -1 is * returned. * <br/> * NOTE: This only works for characters in the range 0-127. * * @param c The character * @param starting The start position * @return The position of the first instance of the character or * -1 if the character is not found. */ public int indexOf(char c, int starting) { int ret = indexOf(buff, start + starting, end, c); return (ret >= start) ? ret - start : -1; }
/** * Returns the first instance of the given character in this ByteChunk * starting at the specified byte. If the character is not found, -1 is * returned. * <br/> * NOTE: This only works for characters in the range 0-127. * * @param c The character * @param starting The start position * @return The position of the first instance of the character or * -1 if the character is not found. */ public int indexOf(char c, int starting) { int ret = indexOf(buff, start + starting, end, c); return (ret >= start) ? ret - start : -1; }
/** * Returns the first instance of the given character in this ByteChunk * starting at the specified byte. If the character is not found, -1 is * returned. * <br/> * NOTE: This only works for characters in the range 0-127. * * @param c The character * @param starting The start position * @return The position of the first instance of the character or * -1 if the character is not found. */ public int indexOf(char c, int starting) { int ret = indexOf(buff, start + starting, end, c); return (ret >= start) ? ret - start : -1; }
/** * Returns the first instance of the given character in this ByteChunk * starting at the specified byte. If the character is not found, -1 is * returned. * <br/> * NOTE: This only works for characters in the range 0-127. * * @param c The character * @param starting The start position * @return The position of the first instance of the character or * -1 if the character is not found. */ public int indexOf(char c, int starting) { int ret = indexOf(buff, start + starting, end, c); return (ret >= start) ? ret - start : -1; }
/** * Returns true if the message bytes starts with the specified string. * @param c the character * @param starting The start position */ public int indexOf(char c, int starting) { switch (type) { case T_STR: return strValue.indexOf( c, starting ); case T_CHARS: return charC.indexOf( c, starting); case T_BYTES: return byteC.indexOf( c, starting ); default: return -1; } }
/** * Returns true if the message bytes starts with the specified string. * @param c the character * @param starting The start position */ public int indexOf(char c, int starting) { switch (type) { case T_STR: return strValue.indexOf( c, starting ); case T_CHARS: return charC.indexOf( c, starting); case T_BYTES: return byteC.indexOf( c, starting ); default: return -1; } }
/** * Returns true if the message bytes starts with the specified string. * @param c the character * @param starting The start position */ public int indexOf(char c, int starting) { switch (type) { case T_STR: return strValue.indexOf( c, starting ); case T_CHARS: return charC.indexOf( c, starting); case T_BYTES: return byteC.indexOf( c, starting ); default: return -1; } }
/** * Returns true if the message bytes starts with the specified string. * @param c the character * @param starting The start position */ public int indexOf(char c, int starting) { switch (type) { case T_STR: return strValue.indexOf( c, starting ); case T_CHARS: return charC.indexOf( c, starting); case T_BYTES: return byteC.indexOf( c, starting ); default: return -1; } }
/** * Returns true if the message bytes starts with the specified string. * @param c the character * @param starting The start position * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ @Deprecated public int indexOf(char c, int starting) { switch (type) { case T_STR: return strValue.indexOf( c, starting ); case T_CHARS: return charC.indexOf( c, starting); case T_BYTES: return byteC.indexOf( c, starting ); default: return -1; } }
/** * Returns true if the message bytes starts with the specified string. * @param c the character * @param starting The start position * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ @Deprecated public int indexOf(char c, int starting) { switch (type) { case T_STR: return strValue.indexOf( c, starting ); case T_CHARS: return charC.indexOf( c, starting); case T_BYTES: return byteC.indexOf( c, starting ); default: return -1; } }
/** * Unescapes any double quotes in the given cookie value. * * @param bc The cookie value to modify */ private static void unescapeDoubleQuotes(ByteChunk bc) { if (bc == null || bc.getLength() == 0 || bc.indexOf('"', 0) == -1) { return; } int src = bc.getStart(); int end = bc.getEnd(); int dest = src; byte[] buffer = bc.getBuffer(); while (src < end) { if (buffer[src] == '\\' && src < end && buffer[src+1] == '"') { src++; } buffer[dest] = buffer[src]; dest ++; src ++; } bc.setEnd(dest); }
/** * Unescapes any double quotes in the given cookie value. * * @param bc The cookie value to modify */ private static void unescapeDoubleQuotes(ByteChunk bc) { if (bc == null || bc.getLength() == 0 || bc.indexOf('"', 0) == -1) { return; } int src = bc.getStart(); int end = bc.getEnd(); int dest = src; byte[] buffer = bc.getBuffer(); while (src < end) { if (buffer[src] == '\\' && src < end && buffer[src+1] == '"') { src++; } buffer[dest] = buffer[src]; dest ++; src ++; } bc.setEnd(dest); }
/** * Unescapes any double quotes in the given cookie value. * * @param bc The cookie value to modify */ private static void unescapeDoubleQuotes(ByteChunk bc) { if (bc == null || bc.getLength() == 0 || bc.indexOf('"', 0) == -1) { return; } int src = bc.getStart(); int end = bc.getEnd(); int dest = src; byte[] buffer = bc.getBuffer(); while (src < end) { if (buffer[src] == '\\' && src < end && buffer[src+1] == '"') { src++; } buffer[dest] = buffer[src]; dest ++; src ++; } bc.setEnd(dest); }
/** * Unescapes any double quotes in the given cookie value. * * @param bc The cookie value to modify */ private static void unescapeDoubleQuotes(ByteChunk bc) { if (bc == null || bc.getLength() == 0 || bc.indexOf('"', 0) == -1) { return; } int src = bc.getStart(); int end = bc.getEnd(); int dest = src; byte[] buffer = bc.getBuffer(); while (src < end) { if (buffer[src] == '\\' && src < end && buffer[src+1] == '"') { src++; } buffer[dest] = buffer[src]; dest ++; src ++; } bc.setEnd(dest); }
/** * Unescapes any double quotes in the given cookie value. * * @param bc The cookie value to modify */ private static void unescapeDoubleQuotes(ByteChunk bc) { if (bc == null || bc.getLength() == 0 || bc.indexOf('"', 0) == -1) { return; } int src = bc.getStart(); int end = bc.getEnd(); int dest = src; byte[] buffer = bc.getBuffer(); while (src < end) { if (buffer[src] == '\\' && src < end && buffer[src+1] == '"') { src++; } buffer[dest] = buffer[src]; dest ++; src ++; } bc.setEnd(dest); }
/** * Unescapes any double quotes in the given cookie value. * * @param bc The cookie value to modify */ public static void unescapeDoubleQuotes(ByteChunk bc) { if (bc == null || bc.getLength() == 0 || bc.indexOf('"', 0) == -1) { return; } int src = bc.getStart(); int end = bc.getEnd(); int dest = src; byte[] buffer = bc.getBuffer(); while (src < end) { if (buffer[src] == '\\' && src < end && buffer[src+1] == '"') { src++; } buffer[dest] = buffer[src]; dest ++; src ++; } bc.setEnd(dest); } }