Class HeaderParser

java.lang.Object
com.bytedesk.call.esl.client.transport.HeaderParser

public class HeaderParser extends Object
This parser provides a static helper method to split a standard Header field into the name and value parts.

This code was copied from the splitHeader() method in the HttpMessageDecoder class, which is licensed under the Apache License version 2. (Original author: Trustin Lee.)

  • Constructor Details

    • HeaderParser

      public HeaderParser()
  • Method Details

    • splitHeader

      public static String[] splitHeader(String sb)
      Split a header in the form
         Header-Name: Some_header-value
       
      into a String array.
      Parameters:
      sb - the string header to parse
      Returns:
      a String[] array with header name at 0 and header value at 1
    • findNonWhitespace

      private static int findNonWhitespace(String sb, int offset)
    • findEndOfString

      private static int findEndOfString(String sb)