|
SIP Communicator: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.media.RawPacket
public class RawPacket
When using TransformConnector, a RTP/RTCP packet is represented using RawPacket. RawPacket stores the buffer holding the RTP/RTCP packet, as well as the inner offset and length of RTP/RTCP packet data. After transformation, data is also store in RawPacket objects, either the original RawPacket (in place transformation), or a newly created RawPacket. Besides packet info storage, RawPacket also provides some other operations such as readInt() to ease the development process.
| Field Summary | |
|---|---|
protected byte[] |
buffer
Byte array storing the content of this Packet |
protected int |
length
Length of this packet's data |
protected int |
offset
Start offset of the packet data inside buffer. |
| Constructor Summary | |
|---|---|
RawPacket(byte[] buffer,
int offset,
int length)
Construct a RawPacket using specified value. |
|
| Method Summary | |
|---|---|
void |
append(byte[] data,
int len)
Append a byte array to then end of the packet. |
byte[] |
getBuffer()
Get buffer containing the content of this packet |
int |
getLength()
Get the length of this packet's data |
int |
getOffset()
Get the start offset of this packet's data inside storing buffer |
byte |
readByte(int off)
Read a byte from this packet at specified offset |
int |
readInt(int off)
Read a integer from this packet at specified offset |
byte[] |
readRegion(int off,
int len)
Read a byte region from specified offset with specified length |
void |
readRegionToBuff(int off,
int len,
byte[] outBuff)
Read a byte region from specified offset with specified length in given buffer |
short |
readShort(int off)
Read a short from this packet at specified offset |
long |
readUnsignedIntAsLong(int off)
Read an unsigned integer as long at specified offset |
int |
readUnsignedShortAsInt(int off)
Read an unsigned short at specified offset as a int |
void |
shrink(int len)
Shrink the buffer of this packet by specified length |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected byte[] buffer
protected int offset
protected int length
| Constructor Detail |
|---|
public RawPacket(byte[] buffer,
int offset,
int length)
buffer - Byte array holding the content of this Packetoffset - Start offset of packet content inside bufferlength - Length of the packet's data| Method Detail |
|---|
public byte[] getBuffer()
public int getLength()
public int getOffset()
public int readInt(int off)
off - start offset of the integer to be read
public short readShort(int off)
off - start offset of this short
public int readUnsignedShortAsInt(int off)
off - start offset of the unsigned short
public byte readByte(int off)
off - start offset of the byte
public long readUnsignedIntAsLong(int off)
off - start offset of this unsigned integer
public byte[] readRegion(int off,
int len)
off - start offset of the region to be readlen - length of the region to be read
public void readRegionToBuff(int off,
int len,
byte[] outBuff)
off - start offset of the region to be readlen - length of the region to be readoutBuff - output buffer
public void append(byte[] data,
int len)
data - byte array to appendlen - the number of bytes to appendpublic void shrink(int len)
len - length to shrink
|
SIP Communicator: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||