public final class Http2CodecUtil extends Object
Modifier and Type | Method and Description |
---|---|
static ByteBuf |
connectionPrefaceBuf()
Returns a buffer containing the the
CONNECTION_PREFACE . |
static ByteBuf |
emptyPingBuf()
Returns a buffer filled with all zeros that is the appropriate length for a PING frame.
|
static <T extends Throwable> |
failAndThrow(ChannelPromise promise,
T cause)
Fails the given promise with the cause and then re-throws the cause.
|
static Http2Exception |
getEmbeddedHttp2Exception(Throwable cause)
Iteratively looks through the causaility chain for the given exception and returns the first
Http2Exception or null if none. |
static Http2StreamRemovalPolicy |
immediateRemovalPolicy()
Returns a simple
Http2StreamRemovalPolicy that immediately calls back the
Http2StreamRemovalPolicy.Action when a stream is marked for removal. |
static boolean |
isMaxFrameSizeValid(int maxFrameSize)
Indicates whether or not the given value for max frame size falls within the valid range.
|
static int |
readUnsignedInt(ByteBuf buf)
Reads a big-endian (31-bit) integer from the buffer.
|
static ByteBuf |
toByteBuf(ChannelHandlerContext ctx,
Throwable cause)
Creates a buffer containing the error message from the given exception.
|
static void |
writeFrameHeader(ByteBuf out,
int payloadLength,
byte type,
Http2Flags flags,
int streamId)
Writes an HTTP/2 frame header to the output buffer.
|
static void |
writeUnsignedInt(long value,
ByteBuf out)
Writes a big-endian (32-bit) unsigned integer to the buffer.
|
static void |
writeUnsignedShort(int value,
ByteBuf out)
Writes a big-endian (16-bit) unsigned integer to the buffer.
|
public static final int CONNECTION_STREAM_ID
public static final int HTTP_UPGRADE_STREAM_ID
public static final String HTTP_UPGRADE_SETTINGS_HEADER
public static final String HTTP_UPGRADE_PROTOCOL_NAME
public static final String TLS_UPGRADE_PROTOCOL_NAME
public static final int PING_FRAME_PAYLOAD_LENGTH
public static final short MAX_UNSIGNED_BYTE
public static final int MAX_UNSIGNED_SHORT
public static final long MAX_UNSIGNED_INT
public static final int FRAME_HEADER_LENGTH
public static final int SETTING_ENTRY_LENGTH
public static final int PRIORITY_ENTRY_LENGTH
public static final int INT_FIELD_LENGTH
public static final short MAX_WEIGHT
public static final short MIN_WEIGHT
public static final int DATA_FRAME_HEADER_LENGTH
public static final int HEADERS_FRAME_HEADER_LENGTH
public static final int PRIORITY_FRAME_LENGTH
public static final int RST_STREAM_FRAME_LENGTH
public static final int PUSH_PROMISE_FRAME_HEADER_LENGTH
public static final int GO_AWAY_FRAME_HEADER_LENGTH
public static final int WINDOW_UPDATE_FRAME_LENGTH
public static final int CONTINUATION_FRAME_HEADER_LENGTH
public static final int SETTINGS_HEADER_TABLE_SIZE
public static final int SETTINGS_ENABLE_PUSH
public static final int SETTINGS_MAX_CONCURRENT_STREAMS
public static final int SETTINGS_INITIAL_WINDOW_SIZE
public static final int SETTINGS_MAX_FRAME_SIZE
public static final int SETTINGS_MAX_HEADER_LIST_SIZE
public static final int MAX_HEADER_TABLE_SIZE
public static final long MAX_CONCURRENT_STREAMS
public static final int MAX_INITIAL_WINDOW_SIZE
public static final int MAX_FRAME_SIZE_LOWER_BOUND
public static final int MAX_FRAME_SIZE_UPPER_BOUND
public static final long MAX_HEADER_LIST_SIZE
public static final long MIN_HEADER_TABLE_SIZE
public static final long MIN_CONCURRENT_STREAMS
public static final int MIN_INITIAL_WINDOW_SIZE
public static final long MIN_HEADER_LIST_SIZE
public static final int DEFAULT_WINDOW_SIZE
public static final boolean DEFAULT_ENABLE_PUSH
public static final short DEFAULT_PRIORITY_WEIGHT
public static final int DEFAULT_HEADER_TABLE_SIZE
public static final int DEFAULT_MAX_HEADER_SIZE
public static final int DEFAULT_MAX_FRAME_SIZE
public static boolean isMaxFrameSizeValid(int maxFrameSize)
public static ByteBuf connectionPrefaceBuf()
CONNECTION_PREFACE
.public static ByteBuf emptyPingBuf()
public static Http2StreamRemovalPolicy immediateRemovalPolicy()
Http2StreamRemovalPolicy
that immediately calls back the
Http2StreamRemovalPolicy.Action
when a stream is marked for removal.public static Http2Exception getEmbeddedHttp2Exception(Throwable cause)
Http2Exception
or null
if none.public static ByteBuf toByteBuf(ChannelHandlerContext ctx, Throwable cause)
null
returns an empty buffer.public static int readUnsignedInt(ByteBuf buf)
public static void writeUnsignedInt(long value, ByteBuf out)
public static void writeUnsignedShort(int value, ByteBuf out)
public static void writeFrameHeader(ByteBuf out, int payloadLength, byte type, Http2Flags flags, int streamId)
public static <T extends Throwable> T failAndThrow(ChannelPromise promise, T cause) throws T extends Throwable
T extends Throwable
Copyright © 2008–2015 The Netty Project. All rights reserved.