Class HttpPostBodyUtil

java.lang.Object
io.netty.handler.codec.http.multipart.HttpPostBodyUtil

final class HttpPostBodyUtil extends Object
Shared Static object between HttpMessageDecoder, HttpPostRequestDecoder and HttpPostRequestEncoder
  • Field Details

    • chunkSize

      public static final int chunkSize
      See Also:
    • DEFAULT_BINARY_CONTENT_TYPE

      public static final String DEFAULT_BINARY_CONTENT_TYPE
      Default Content-Type in binary form
      See Also:
    • DEFAULT_TEXT_CONTENT_TYPE

      public static final String DEFAULT_TEXT_CONTENT_TYPE
      Default Content-Type in Text form
      See Also:
  • Constructor Details

    • HttpPostBodyUtil

      private HttpPostBodyUtil()
  • Method Details

    • findNonWhitespace

      static int findNonWhitespace(String sb, int offset)
      Find the first non whitespace
      Returns:
      the rank of the first non whitespace
    • findEndOfString

      static int findEndOfString(String sb)
      Find the end of String
      Returns:
      the rank of the end of string
    • findLineBreak

      static int findLineBreak(ByteBuf buffer, int index)
      Try to find first LF or CRLF as Line Breaking
      Parameters:
      buffer - the buffer to search in
      index - the index to start from in the buffer
      Returns:
      a relative position from index > 0 if LF or CRLF is found or invalid input: '<' 0 if not found
    • findLastLineBreak

      static int findLastLineBreak(ByteBuf buffer, int index)
      Try to find last LF or CRLF as Line Breaking
      Parameters:
      buffer - the buffer to search in
      index - the index to start from in the buffer
      Returns:
      a relative position from index > 0 if LF or CRLF is found or invalid input: '<' 0 if not found
    • findDelimiter

      static int findDelimiter(ByteBuf buffer, int index, byte[] delimiter, boolean precededByLineBreak)
      Try to find the delimiter, with LF or CRLF in front of it (added as delimiters) if needed
      Parameters:
      buffer - the buffer to search in
      index - the index to start from in the buffer
      delimiter - the delimiter as byte array
      precededByLineBreak - true if it must be preceded by LF or CRLF, else false
      Returns:
      a relative position from index > 0 if delimiter found designing the start of it (including LF or CRLF is asked) or a number invalid input: '<' 0 if delimiter is not found
      Throws:
      IndexOutOfBoundsException - if offset + delimiter.length is greater than buffer.capacity