Top Description Inners Fields Constructors Methods
io.netty.handler.codec.http.multipart

pack-priv final Class HttpPostBodyUtil

extends Object
Class Inheritance
Imports
io.netty.buffer.ByteBuf, io.netty.handler.codec.http.HttpConstants

Shared Static object between HttpMessageDecoder, HttpPostRequestDecoder and HttpPostRequestEncoder

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
HttpPostBodyUtil.SeekAheadOptimize

This class intends to decrease the CPU in seeking ahead some bytes in HttpPostRequestDecoder

public static enum
HttpPostBodyUtil.TransferEncodingMechanism

Allowed mechanism for multipart mechanism := "7bit" / "8bit" / "binary" Not allowed: "quoted-printable" / "base64"

Field Summary

Modifier and TypeField and Description
public static final int
public static final String
DEFAULT_BINARY_CONTENT_TYPE

Default Content-Type in binary form

public static final String
DEFAULT_TEXT_CONTENT_TYPE

Default Content-Type in Text form

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static int

Returns:

a relative position from index > 0 if delimiter found designing the start of it (including LF or CRLF is asked) or a number < 0 if delimiter is not found
findDelimiter
(ByteBuf
the buffer to search in
buffer
,
int
the index to start from in the buffer
index
,
byte[]
the delimiter as byte array
delimiter
,
boolean
true if it must be preceded by LF or CRLF, else false
precededByLineBreak
)

Try to find the delimiter, with LF or CRLF in front of it (added as delimiters) if needed

pack-priv static int

Returns:

the rank of the end of string
findEndOfString
(String sb)

Find the end of String

pack-priv static int

Returns:

a relative position from index > 0 if LF or CRLF is found or < 0 if not found
findLastLineBreak
(ByteBuf
the buffer to search in
buffer
,
int
the index to start from in the buffer
index
)

Try to find last LF or CRLF as Line Breaking

pack-priv static int

Returns:

a relative position from index > 0 if LF or CRLF is found or < 0 if not found
findLineBreak
(ByteBuf
the buffer to search in
buffer
,
int
the index to start from in the buffer
index
)

Try to find first LF or CRLF as Line Breaking

pack-priv static int

Returns:

the rank of the first non whitespace
findNonWhitespace
(String sb, int offset)

Find the first non whitespace

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

chunkSizeback to summary
public static final int chunkSize
DEFAULT_BINARY_CONTENT_TYPEback to summary
public static final String DEFAULT_BINARY_CONTENT_TYPE

Default Content-Type in binary form

DEFAULT_TEXT_CONTENT_TYPEback to summary
public static final String DEFAULT_TEXT_CONTENT_TYPE

Default Content-Type in Text form

Constructor Detail

HttpPostBodyUtilback to summary
private HttpPostBodyUtil()

Method Detail

findDelimiterback to summary
pack-priv 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:ByteBuf

the buffer to search in

index:int

the index to start from in the buffer

delimiter:byte[]

the delimiter as byte array

precededByLineBreak:boolean

true if it must be preceded by LF or CRLF, else false

Returns:int

a relative position from index > 0 if delimiter found designing the start of it (including LF or CRLF is asked) or a number < 0 if delimiter is not found

Exceptions
IndexOutOfBoundsException:
if offset + delimiter.length is greater than buffer.capacity
findEndOfStringback to summary
pack-priv static int findEndOfString(String sb)

Find the end of String

Returns:int

the rank of the end of string

findLastLineBreakback to summary
pack-priv static int findLastLineBreak(ByteBuf buffer, int index)

Try to find last LF or CRLF as Line Breaking

Parameters
buffer:ByteBuf

the buffer to search in

index:int

the index to start from in the buffer

Returns:int

a relative position from index > 0 if LF or CRLF is found or < 0 if not found

findLineBreakback to summary
pack-priv static int findLineBreak(ByteBuf buffer, int index)

Try to find first LF or CRLF as Line Breaking

Parameters
buffer:ByteBuf

the buffer to search in

index:int

the index to start from in the buffer

Returns:int

a relative position from index > 0 if LF or CRLF is found or < 0 if not found

findNonWhitespaceback to summary
pack-priv static int findNonWhitespace(String sb, int offset)

Find the first non whitespace

Returns:int

the rank of the first non whitespace

io.netty.handler.codec.http.multipart back to summary

pack-priv Class HttpPostBodyUtil.SeekAheadOptimize

extends Object
Class Inheritance
  • java.lang.Object
  • io.netty.handler.codec.http.multipart.HttpPostBodyUtil.SeekAheadOptimize

This class intends to decrease the CPU in seeking ahead some bytes in HttpPostRequestDecoder

Field Summary

Modifier and TypeField and Description
pack-priv ByteBuf
pack-priv byte[]
pack-priv int
pack-priv int
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
SeekAheadOptimize(ByteBuf
buffer with a backing byte array
buffer
)

Method Summary

Modifier and TypeMethod and Description
pack-priv int

Returns:

the value equivalent of raw index to be used in readerIndex(value)
getReadPosition
(int
raw index of the array (pos in general)
index
)

pack-priv void
setReadPosition(int
this value will be used as (currentPos - minus) to set the current readerIndex in the buffer.
minus
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferback to summary
pack-priv ByteBuf buffer
bytesback to summary
pack-priv byte[] bytes
limitback to summary
pack-priv int limit
origPosback to summary
pack-priv int origPos
posback to summary
pack-priv int pos
readerIndexback to summary
pack-priv int readerIndex

Constructor Detail

SeekAheadOptimizeback to summary
pack-priv SeekAheadOptimize(ByteBuf buffer)
Parameters
buffer:ByteBuf

buffer with a backing byte array

Method Detail

getReadPositionback to summary
pack-priv int getReadPosition(int index)
Parameters
index:int

raw index of the array (pos in general)

Returns:int

the value equivalent of raw index to be used in readerIndex(value)

setReadPositionback to summary
pack-priv void setReadPosition(int minus)
Parameters
minus:int

this value will be used as (currentPos - minus) to set the current readerIndex in the buffer.

io.netty.handler.codec.http.multipart back to summary

public final Enum HttpPostBodyUtil.TransferEncodingMechanism

extends Enum<HttpPostBodyUtil.TransferEncodingMechanism>
Class Inheritance

Allowed mechanism for multipart mechanism := "7bit" / "8bit" / "binary" Not allowed: "quoted-printable" / "base64"

Field Summary

Modifier and TypeField and Description
public static final HttpPostBodyUtil.TransferEncodingMechanism
BINARY

Could be long text not in ASCII - no encoding

public static final HttpPostBodyUtil.TransferEncodingMechanism
BIT7

Default encoding

public static final HttpPostBodyUtil.TransferEncodingMechanism
BIT8

Short lines but not in ASCII - no encoding

private final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration.
public String
public static HttpPostBodyUtil.TransferEncodingMechanism
public static HttpPostBodyUtil.TransferEncodingMechanism[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinalvalueOf

Field Detail

BINARYback to summary
public static final HttpPostBodyUtil.TransferEncodingMechanism BINARY

Could be long text not in ASCII - no encoding

BIT7back to summary
public static final HttpPostBodyUtil.TransferEncodingMechanism BIT7

Default encoding

BIT8back to summary
public static final HttpPostBodyUtil.TransferEncodingMechanism BIT8

Short lines but not in ASCII - no encoding

valueback to summary
private final String value

Constructor Detail

TransferEncodingMechanismback to summary
private TransferEncodingMechanism(String value)

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Enum.toString.

Doc from java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum class should override this method when a more "programmer-friendly" string form exists.

Returns:String

the name of this enum constant

Annotations
@Override
valueback to summary
public String value()
valueOfback to summary
public static HttpPostBodyUtil.TransferEncodingMechanism valueOf(String name)
valuesback to summary
public static HttpPostBodyUtil.TransferEncodingMechanism[] values()