|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.beep4j.internal.DataHeader
public class DataHeader
Represents a data header as specified by the BEEP specification.
Nested Class Summary | |
---|---|
static class |
DataHeader.ANSHeader
Header for messages of type ANS. |
Field Summary | |
---|---|
protected int |
channel
The channel number of the frame. |
protected boolean |
intermediate
Whether this is an intermediate frame. |
protected int |
messageNumber
The message number of the frame. |
protected int |
payloadSize
The size of the frame's payload. |
protected long |
sequenceNumber
The sequence number of the first byte in the frame's payload. |
protected MessageType |
type
The message type of the frame. |
Constructor Summary | |
---|---|
DataHeader(MessageType type,
int channel,
int messageNumber,
boolean intermediate,
long sequenceNumber,
int size)
Creates a new DataHeader. |
Method Summary | |
---|---|
java.nio.ByteBuffer |
asByteBuffer()
Converts the header into a ByteBuffer. |
boolean |
equals(java.lang.Object obj)
|
int |
getChannel()
|
int |
getMessageNumber()
|
int |
getPayloadSize()
|
long |
getSequenceNumber()
|
MessageType |
getType()
|
int |
hashCode()
|
boolean |
isIntermediate()
|
static DataHeader |
parseHeader(java.lang.String[] tokens)
Parses the passed in tokenized header line into a DataHeader. |
DataHeader[] |
split(int size)
Splits the header into two parts. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected MessageType type
protected int payloadSize
protected int channel
protected int messageNumber
protected boolean intermediate
protected long sequenceNumber
Constructor Detail |
---|
public DataHeader(MessageType type, int channel, int messageNumber, boolean intermediate, long sequenceNumber, int size)
type
- the message type of the framechannel
- the channel number, must be greater or equal than zeromessageNumber
- the message number of the frameintermediate
- whether this is an intermediate framesequenceNumber
- the sequence number of the framesize
- the payload size of the frameMethod Detail |
---|
public static final DataHeader parseHeader(java.lang.String[] tokens)
tokens
- the tokenized header line
public MessageType getType()
public int getChannel()
public int getMessageNumber()
public boolean isIntermediate()
public int getPayloadSize()
public long getSequenceNumber()
public DataHeader[] split(int size)
size
- the size of the first part
public java.nio.ByteBuffer asByteBuffer()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |