public class CloseInfo
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private byte[] |
reasonBytes |
private int |
statusCode |
Constructor and Description |
---|
CloseInfo() |
CloseInfo(java.nio.ByteBuffer payload,
boolean validate)
Parse the Close Frame payload.
|
CloseInfo(Frame frame) |
CloseInfo(Frame frame,
boolean validate) |
CloseInfo(int statusCode) |
CloseInfo(int statusCode,
java.lang.String reason)
Create a CloseInfo, trimming the reason to
CloseStatus.MAX_REASON_PHRASE UTF-8 bytes if needed. |
Modifier and Type | Method and Description |
---|---|
private java.nio.ByteBuffer |
asByteBuffer() |
CloseFrame |
asFrame() |
private void |
assertValidStatusCode(int statusCode) |
java.lang.String |
getReason() |
int |
getStatusCode() |
boolean |
isAbnormal() |
boolean |
isHarsh() |
java.lang.String |
toString() |
public CloseInfo()
public CloseInfo(java.nio.ByteBuffer payload, boolean validate)
payload
- the raw close frame payload.validate
- true if payload should be validated per WebSocket spec.public CloseInfo(Frame frame)
public CloseInfo(Frame frame, boolean validate)
public CloseInfo(int statusCode)
public CloseInfo(int statusCode, java.lang.String reason)
CloseStatus.MAX_REASON_PHRASE
UTF-8 bytes if needed.statusCode
- the status codereason
- the raw reason codeprivate void assertValidStatusCode(int statusCode)
private java.nio.ByteBuffer asByteBuffer()
public CloseFrame asFrame()
public java.lang.String getReason()
public int getStatusCode()
public boolean isHarsh()
public boolean isAbnormal()
public java.lang.String toString()
toString
in class java.lang.Object