Fields Summary |
---|
private static final int | WAP_PDU_SHORT_LENGTH_MAX |
private static final int | WAP_PDU_LENGTH_QUOTE |
public static final int | PDU_TYPE_PUSH |
public static final int | PDU_TYPE_CONFIRMED_PUSH |
public static final int | CONTENT_TYPE_B_DRM_RIGHTS_XML |
public static final int | CONTENT_TYPE_B_DRM_RIGHTS_WBXML |
public static final int | CONTENT_TYPE_B_PUSH_SI |
public static final int | CONTENT_TYPE_B_PUSH_SL |
public static final int | CONTENT_TYPE_B_PUSH_CO |
public static final int | CONTENT_TYPE_B_MMS |
public static final String | CONTENT_MIME_TYPE_B_DRM_RIGHTS_XML |
public static final String | CONTENT_MIME_TYPE_B_DRM_RIGHTS_WBXML |
public static final String | CONTENT_MIME_TYPE_B_PUSH_SI |
public static final String | CONTENT_MIME_TYPE_B_PUSH_SL |
public static final String | CONTENT_MIME_TYPE_B_PUSH_CO |
public static final String | CONTENT_MIME_TYPE_B_MMS |
public static final int | PARAMETER_ID_X_WAP_APPLICATION_ID |
byte[] | wspData |
int | dataLength |
long | unsigned32bit |
String | stringValue |
Methods Summary |
---|
public boolean | decodeConstrainedEncoding(int startIndex)Decode the "Constrained-encoding" type for WSP pdu
if (decodeShortInteger(startIndex) == true) {
stringValue = null;
return true;
}
return decodeExtensionMedia(startIndex);
|
public boolean | decodeContentLength(int startIndex)Decode the "Content length" type for WSP pdu
return decodeIntegerValue(startIndex);
|
public boolean | decodeContentLocation(int startIndex)Decode the "Content location" type for WSP pdu
return decodeTextString(startIndex);
|
public boolean | decodeContentType(int startIndex)Decode the "Content-type" type for WSP pdu
int mediaPrefixLength;
long mediaFieldLength;
if (decodeValueLength(startIndex) == false) {
return decodeConstrainedEncoding(startIndex);
}
mediaPrefixLength = getDecodedDataLength();
mediaFieldLength = getValue32();
if (decodeIntegerValue(startIndex + mediaPrefixLength) == true) {
dataLength += mediaPrefixLength;
stringValue = null;
return true;
}
if (decodeExtensionMedia(startIndex + mediaPrefixLength) == true) {
dataLength += mediaPrefixLength;
return true;
}
return false;
|
public boolean | decodeExtensionMedia(int startIndex)Decode the "Extension-media" type for WSP pdu
int index = startIndex;
while (wspData[index] != 0) {
index++;
}
dataLength = index - startIndex + 1;
stringValue = new String(wspData, startIndex, dataLength - 1);
return true;
|
public boolean | decodeIntegerValue(int startIndex)Decode the "Integer-Value" type for WSP pdu
if (decodeShortInteger(startIndex) == true) {
return true;
}
return decodeLongInteger(startIndex);
|
public boolean | decodeLongInteger(int startIndex)Decode the "Long-integer" type for WSP pdu
int lengthMultiOctet = wspData[startIndex] & 0xff;
if (lengthMultiOctet > WAP_PDU_SHORT_LENGTH_MAX) {
return false;
}
unsigned32bit = 0;
for (int i=1; i<=lengthMultiOctet; i++) {
unsigned32bit = (unsigned32bit << 8) | (wspData[startIndex+i] & 0xff);
}
dataLength = 1+lengthMultiOctet;
return true;
|
public boolean | decodeShortInteger(int startIndex)Decode the "Short-integer" type for WSP pdu
if ((wspData[startIndex] & 0x80) == 0) {
return false;
}
unsigned32bit = wspData[startIndex] & 0x7f;
dataLength = 1;
return true;
|
public boolean | decodeTextString(int startIndex)Decode the "Text-string" type for WSP pdu
int index = startIndex;
while (wspData[index] != 0) {
index++;
}
dataLength = index - startIndex + 1;
if (wspData[startIndex] == 127) {
stringValue = new String(wspData, startIndex+1, dataLength - 2);
} else {
stringValue = new String(wspData, startIndex, dataLength - 1);
}
return true;
|
public boolean | decodeUintvarInteger(int startIndex)Decode the "Uintvar-integer" type for WSP pdu
int index = startIndex;
unsigned32bit = 0;
while ((wspData[index] & 0x80) != 0) {
if ((index - startIndex) >= 4) {
return false;
}
unsigned32bit = (unsigned32bit << 7) | (wspData[index] & 0x7f);
index++;
}
unsigned32bit = (unsigned32bit << 7) | (wspData[index] & 0x7f);
dataLength = index - startIndex + 1;
return true;
|
public boolean | decodeValueLength(int startIndex)Decode the "Value-length" type for WSP pdu
if ((wspData[startIndex] & 0xff) > WAP_PDU_LENGTH_QUOTE) {
return false;
}
if (wspData[startIndex] < WAP_PDU_LENGTH_QUOTE) {
unsigned32bit = wspData[startIndex];
dataLength = 1;
} else {
decodeUintvarInteger(startIndex+1);
dataLength ++;
}
return true;
|
public boolean | decodeXWapApplicationId(int startIndex)Decode the "X-Wap-Application-Id" type for WSP pdu
if (decodeIntegerValue(startIndex) == true) {
stringValue = null;
return true;
}
return decodeTextString(startIndex);
|
public boolean | decodeXWapContentURI(int startIndex)Decode the "X-Wap-Content-URI" type for WSP pdu
return decodeTextString(startIndex);
|
public boolean | decodeXWapInitiatorURI(int startIndex)Decode the "X-Wap-Initiator-URI" type for WSP pdu
return decodeTextString(startIndex);
|
public int | getDecodedDataLength()The data length of latest operation.
return dataLength;
|
public long | getValue32()The 32-bits result of latest operation.
return unsigned32bit;
|
public java.lang.String | getValueString()The String result of latest operation.
return stringValue;
|