类 HttpTunnelPayload
- java.lang.Object
- org.springframework.boot.devtools.tunnel.payload.HttpTunnelPayload
public class HttpTunnelPayload extends Object
Encapsulates a payload data sent via a HTTP tunnel.- 从以下版本开始:
- 1.3.0
字段概要
字段 修饰符和类型 字段 说明 protected static char[]HEX_CHARS
构造器概要
构造器 构造器 说明 HttpTunnelPayload(long sequence, ByteBuffer data)Create a newHttpTunnelPayloadinstance.
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voidassignTo(org.springframework.http.HttpOutputMessage message)Assign this payload to the givenHttpOutputMessage.static HttpTunnelPayloadget(org.springframework.http.HttpInputMessage message)Return theHttpTunnelPayloadfor the given message ornullif there is no payload.static ByteBuffergetPayloadData(ReadableByteChannel channel)Return the payload data for the given sourceReadableByteChannelor null if the channel timed out whilst reading.longgetSequence()Return the sequence number of the payload.voidlogIncoming()Log incoming payload information at trace level to aid diagnostics.voidlogOutgoing()Log incoming payload information at trace level to aid diagnostics.StringtoHexString()Return the payload as a hexadecimal string.voidwriteTo(WritableByteChannel channel)Write the content of this payload to the given target channel.
字段详细资料
HEX_CHARS
protected static final char[] HEX_CHARS
构造器详细资料
HttpTunnelPayload
public HttpTunnelPayload(long sequence, ByteBuffer data)
Create a newHttpTunnelPayloadinstance.- 参数:
sequence- the sequence number of the payloaddata- the payload data
方法详细资料
getSequence
public long getSequence()
Return the sequence number of the payload.- 返回:
- the sequence
assignTo
public void assignTo(org.springframework.http.HttpOutputMessage message) throws IOException
Assign this payload to the givenHttpOutputMessage.- 参数:
message- the message to assign this payload to- 抛出:
IOException- in case of I/O errors
writeTo
public void writeTo(WritableByteChannel channel) throws IOException
Write the content of this payload to the given target channel.- 参数:
channel- the channel to write to- 抛出:
IOException- in case of I/O errors
get
public static HttpTunnelPayload get(org.springframework.http.HttpInputMessage message) throws IOException
Return theHttpTunnelPayloadfor the given message ornullif there is no payload.- 参数:
message- the HTTP message- 返回:
- the payload or
null - 抛出:
IOException- in case of I/O errors
getPayloadData
public static ByteBuffer getPayloadData(ReadableByteChannel channel) throws IOException
Return the payload data for the given sourceReadableByteChannelor null if the channel timed out whilst reading.- 参数:
channel- the source channel- 返回:
- payload data or
null - 抛出:
IOException- in case of I/O errors
logIncoming
public void logIncoming()
Log incoming payload information at trace level to aid diagnostics.
logOutgoing
public void logOutgoing()
Log incoming payload information at trace level to aid diagnostics.
toHexString
public String toHexString()
Return the payload as a hexadecimal string.- 返回:
- the payload as a hex string