/** * Optimised lookup to find a method name and trailing space in a byte array. * @param buffer buffer containing ISO-8859-1 characters * @return A HttpMethod if a match or null if no easy match. */ public static HttpMethod lookAheadGet(ByteBuffer buffer) { if (buffer.hasArray()) return lookAheadGet(buffer.array(),buffer.arrayOffset()+buffer.position(),buffer.arrayOffset()+buffer.limit()); return CACHE.getBest(buffer,0,buffer.remaining()); }
/** * Optimised lookup to find a method name and trailing space in a byte array. * @param buffer buffer containing ISO-8859-1 characters * @return A HttpMethod if a match or null if no easy match. */ public static HttpMethod lookAheadGet(ByteBuffer buffer) { if (buffer.hasArray()) return lookAheadGet(buffer.array(),buffer.arrayOffset()+buffer.position(),buffer.arrayOffset()+buffer.limit()); return CACHE.getBest(buffer,0,buffer.remaining()); }
/** * Optimized lookup to find a method name and trailing space in a byte array. * @param buffer buffer containing ISO-8859-1 characters, it is not modified. * @return A HttpMethod if a match or null if no easy match. */ public static HttpMethod lookAheadGet(ByteBuffer buffer) { if (buffer.hasArray()) return lookAheadGet(buffer.array(),buffer.arrayOffset()+buffer.position(),buffer.arrayOffset()+buffer.limit()); int l = buffer.remaining(); if (l>=4) { HttpMethod m = CACHE.getBest(buffer,0,l); if (m!=null) { int ml = m.asString().length(); if (l>ml && buffer.get(buffer.position()+ml)==' ') return m; } } return null; }
/** * Optimized lookup to find a method name and trailing space in a byte array. * @param buffer buffer containing ISO-8859-1 characters, it is not modified. * @return A HttpMethod if a match or null if no easy match. */ public static HttpMethod lookAheadGet(ByteBuffer buffer) { if (buffer.hasArray()) return lookAheadGet(buffer.array(),buffer.arrayOffset()+buffer.position(),buffer.arrayOffset()+buffer.limit()); int l = buffer.remaining(); if (l>=4) { HttpMethod m = CACHE.getBest(buffer,0,l); if (m!=null) { int ml = m.asString().length(); if (l>ml && buffer.get(buffer.position()+ml)==' ') return m; } } return null; }
/** * Optimized lookup to find a method name and trailing space in a byte array. * @param buffer buffer containing ISO-8859-1 characters, it is not modified. * @return A HttpMethod if a match or null if no easy match. */ public static HttpMethod lookAheadGet(ByteBuffer buffer) { if (buffer.hasArray()) return lookAheadGet(buffer.array(),buffer.arrayOffset()+buffer.position(),buffer.arrayOffset()+buffer.limit()); int l = buffer.remaining(); if (l>=4) { HttpMethod m = CACHE.getBest(buffer,0,l); if (m!=null) { int ml = m.asString().length(); if (l>ml && buffer.get(buffer.position()+ml)==' ') return m; } } return null; }
/** * Optimized lookup to find a method name and trailing space in a byte array. * @param buffer buffer containing ISO-8859-1 characters, it is not modified. * @return A HttpMethod if a match or null if no easy match. */ public static HttpMethod lookAheadGet(ByteBuffer buffer) { if (buffer.hasArray()) return lookAheadGet(buffer.array(),buffer.arrayOffset()+buffer.position(),buffer.arrayOffset()+buffer.limit()); int l = buffer.remaining(); if (l>=4) { HttpMethod m = CACHE.getBest(buffer,0,l); if (m!=null) { int ml = m.asString().length(); if (l>ml && buffer.get(buffer.position()+ml)==' ') return m; } } return null; }
_method = HttpMethod.lookAheadGet(buffer); if (_method!=null)
_method = HttpMethod.lookAheadGet(buffer); if (_method!=null)
_method = HttpMethod.lookAheadGet(buffer); if (_method!=null)
_method = HttpMethod.lookAheadGet(buffer); if (_method!=null)
_method = HttpMethod.lookAheadGet(buffer); if (_method!=null)
_method = HttpMethod.lookAheadGet(buffer); if (_method!=null)