public class Header
extends chat.dim.type.Data
| Modifier and Type | Field and Description |
|---|---|
int |
bodyLength |
int |
index |
static byte[] |
MAGIC_CODE |
static int |
MAX_BODY_LENGTH |
static int |
MAX_PAGES |
int |
pages |
TransactionID |
sn |
DataType |
type |
| Constructor and Description |
|---|
Header(chat.dim.type.ByteArray data,
DataType type,
TransactionID sn,
int pages,
int index,
int bodyLen)
Create package header
|
| Modifier and Type | Method and Description |
|---|---|
static Header |
create(DataType type) |
static Header |
create(DataType type,
int bodyLen) |
static Header |
create(DataType type,
int pages,
int index) |
static Header |
create(DataType type,
TransactionID sn) |
static Header |
create(DataType type,
TransactionID sn,
int bodyLen) |
static Header |
create(DataType type,
TransactionID sn,
int pages,
int index) |
static Header |
create(DataType type,
TransactionID sn,
int pages,
int index,
int bodyLen) |
boolean |
isCommand() |
boolean |
isCommandResponse() |
boolean |
isFragment() |
boolean |
isMessage() |
boolean |
isMessageFragment() |
boolean |
isMessageResponse() |
boolean |
isResponse() |
static Header |
parse(chat.dim.type.ByteArray data) |
clone, concat, concat, equals, equals, equals, equals, find, find, find, find, find, find, find, find, find, find, find, find, getBuffer, getByte, getBytes, getBytes, getBytes, getOffset, getSize, hashCode, mutableCopy, random, slice, slice, toHexString, toStringpublic final DataType type
public final TransactionID sn
public final int pages
public final int index
public final int bodyLength
public static int MAX_BODY_LENGTH
public static int MAX_PAGES
public static final byte[] MAGIC_CODE
public Header(chat.dim.type.ByteArray data,
DataType type,
TransactionID sn,
int pages,
int index,
int bodyLen)
data - - header data viewtype - - package body data typesn - - transaction IDpages - - fragment count [OPTIONAL], default is 1index - - fragment index [OPTIONAL], default is 0bodyLen - - length of body [OPTIONAL], default is -1 (unlimited)public boolean isResponse()
public boolean isFragment()
public boolean isCommand()
public boolean isCommandResponse()
public boolean isMessage()
public boolean isMessageResponse()
public boolean isMessageFragment()
public static Header parse(chat.dim.type.ByteArray data)
public static Header create(DataType type, TransactionID sn, int pages, int index, int bodyLen)
public static Header create(DataType type, TransactionID sn, int pages, int index)
public static Header create(DataType type, TransactionID sn)
public static Header create(DataType type, TransactionID sn, int bodyLen)