|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.protocols.smpp.util.PacketDecoderImpl
public class PacketDecoderImpl
Implementation of the packet decoder.
| Constructor Summary | |
|---|---|
PacketDecoderImpl()
|
|
PacketDecoderImpl(byte[] bytes)
|
|
PacketDecoderImpl(byte[] bytes,
int parsePosition)
|
|
| Method Summary | |
|---|---|
int |
getAvailableBytes()
Get the number of available bytes to be read by this decoder. |
byte[] |
getBytes()
|
int |
getParsePosition()
Get the current parse position of this packet decoder. |
Address |
readAddress()
Read an SMPP address from the byte array. |
byte |
readByte()
Read a byte from the byte array. |
byte[] |
readBytes(int length)
Get a byte array sub-set from the specified byte array. |
String |
readCString()
Read a C-String (a string terminated by a nul-byte) from the byte array. |
SMPPDate |
readDate()
Read an SMPP date from the byte array. |
ErrorAddress |
readErrorAddress()
Read an SMPP address and error code pairing. |
long |
readInt8()
|
String |
readString(int length)
Read a fixed-length String from the bytes. |
int |
readUInt1()
Read a 1-byte unsigned integer from the array. |
int |
readUInt2()
Read a 2-byte unsigned integer from the array. |
long |
readUInt4()
Read a 4-byte unsigned integer from the array. |
void |
setBytes(byte[] bytes)
|
void |
setParsePosition(int pos)
Set the current parse position of this decoder. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PacketDecoderImpl()
public PacketDecoderImpl(byte[] bytes)
public PacketDecoderImpl(byte[] bytes,
int parsePosition)
| Method Detail |
|---|
public byte[] getBytes()
public void setBytes(byte[] bytes)
public int getParsePosition()
PacketDecoder
getParsePosition in interface PacketDecoderpublic void setParsePosition(int pos)
PacketDecoder
setParsePosition in interface PacketDecoderpos - The new parse position.public int getAvailableBytes()
PacketDecoder
getAvailableBytes in interface PacketDecoderpublic byte readByte()
PacketDecoder
readByte in interface PacketDecoderpublic String readCString()
PacketDecoder
readCString in interface PacketDecoderpublic String readString(int length)
PacketDecoder
readString in interface PacketDecoderlength - The number of bytes to parse for the string.
public int readUInt1()
PacketDecoder
readUInt1 in interface PacketDecoderpublic int readUInt2()
PacketDecoder
readUInt2 in interface PacketDecoderpublic long readUInt4()
PacketDecoderlong primitive is required to hold
all the possible values.
readUInt4 in interface PacketDecoderpublic long readInt8()
readInt8 in interface PacketDecoderpublic Address readAddress()
PacketDecoder
readAddress in interface PacketDecoderpublic ErrorAddress readErrorAddress()
PacketDecoder
readErrorAddress in interface PacketDecoderpublic SMPPDate readDate()
PacketDecoder
readDate in interface PacketDecodernull if the date is null.public byte[] readBytes(int length)
PacketDecoder
readBytes in interface PacketDecoderlength - The number of bytes to copy out of the array.
length bytes in it copied
from bytes.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||