Lines Matching refs:startIndex

213      * @param startIndex The starting position of the "Text-string" in this pdu
219 public boolean decodeTextString(int startIndex) {
220 int index = startIndex;
224 mDataLength = index - startIndex + 1;
225 if (mWspData[startIndex] == 127) {
226 mStringValue = new String(mWspData, startIndex + 1, mDataLength - 2);
228 mStringValue = new String(mWspData, startIndex, mDataLength - 1);
236 * @param startIndex The starting position of the "Token-text" in this pdu
242 public boolean decodeTokenText(int startIndex) {
243 int index = startIndex;
247 mDataLength = index - startIndex + 1;
248 mStringValue = new String(mWspData, startIndex, mDataLength - 1);
256 * @param startIndex The starting position of the "Short-integer" in this pdu
262 public boolean decodeShortInteger(int startIndex) {
263 if ((mWspData[startIndex] & 0x80) == 0) {
266 mUnsigned32bit = mWspData[startIndex] & 0x7f;
274 * @param startIndex The starting position of the "Long-integer" in this pdu
280 public boolean decodeLongInteger(int startIndex) {
281 int lengthMultiOctet = mWspData[startIndex] & 0xff;
288 mUnsigned32bit = (mUnsigned32bit << 8) | (mWspData[startIndex + i] & 0xff);
297 * @param startIndex The starting position of the "Integer-Value" in this pdu
303 public boolean decodeIntegerValue(int startIndex) {
304 if (decodeShortInteger(startIndex) == true) {
307 return decodeLongInteger(startIndex);
313 * @param startIndex The starting position of the "Uintvar-integer" in this pdu
319 public boolean decodeUintvarInteger(int startIndex) {
320 int index = startIndex;
324 if ((index - startIndex) >= 4) {
331 mDataLength = index - startIndex + 1;
338 * @param startIndex The starting position of the "Value-length" in this pdu
344 public boolean decodeValueLength(int startIndex) {
345 if ((mWspData[startIndex] & 0xff) > WAP_PDU_LENGTH_QUOTE) {
348 if (mWspData[startIndex] < WAP_PDU_LENGTH_QUOTE) {
349 mUnsigned32bit = mWspData[startIndex];
352 decodeUintvarInteger(startIndex + 1);
361 * @param startIndex The starting position of the "Extension-media" in this PDU.
363 * @return false on error, such as if there is no Extension-media at startIndex.
368 public boolean decodeExtensionMedia(int startIndex) {
369 int index = startIndex;
379 mDataLength = index - startIndex + 1;
380 mStringValue = new String(mWspData, startIndex, mDataLength - 1);
388 * @param startIndex The starting position of the "Constrained-encoding" in this pdu
394 public boolean decodeConstrainedEncoding(int startIndex) {
395 if (decodeShortInteger(startIndex) == true) {
399 return decodeExtensionMedia(startIndex);
405 * @param startIndex The starting position of the "Content-type" in this pdu
415 public boolean decodeContentType(int startIndex) {
420 if (decodeValueLength(startIndex) == false) {
421 boolean found = decodeConstrainedEncoding(startIndex);
429 if (decodeIntegerValue(startIndex + mediaPrefixLength) == true) {
436 if (readContentParameters(startIndex + mDataLength,
445 if (decodeExtensionMedia(startIndex + mediaPrefixLength) == true) {
451 if (readContentParameters(startIndex + mDataLength,
466 private boolean readContentParameters(int startIndex, int leftToRead, int accumulator) {
471 byte nextByte = mWspData[startIndex];
475 decodeTokenText(startIndex);
479 if (decodeIntegerValue(startIndex)) {
488 if (decodeUintvarInteger(startIndex + totalRead)) {
492 return readContentParameters(startIndex + totalRead, leftToRead
503 if (decodeNoValue(startIndex + totalRead)) {
506 } else if (decodeIntegerValue(startIndex + totalRead)) {
511 decodeTokenText(startIndex + totalRead);
520 return readContentParameters(startIndex + totalRead, leftToRead - totalRead,
532 * @param startIndex The starting position of the "Content length" in this pdu
536 private boolean decodeNoValue(int startIndex) {
537 if (mWspData[startIndex] == 0) {
562 * @param startIndex The starting position of the "Content length" in this pdu
568 public boolean decodeContentLength(int startIndex) {
569 return decodeIntegerValue(startIndex);
575 * @param startIndex The starting position of the "Content location" in this pdu
581 public boolean decodeContentLocation(int startIndex) {
582 return decodeTextString(startIndex);
588 * @param startIndex The starting position of the "X-Wap-Application-Id" in this pdu
595 public boolean decodeXWapApplicationId(int startIndex) {
596 if (decodeIntegerValue(startIndex) == true) {
600 return decodeTextString(startIndex);
606 * @param startIndex The starting position of seek pointer
612 public boolean seekXWapApplicationId(int startIndex, int endIndex) {
613 int index = startIndex;
616 for (index = startIndex; index <= endIndex; ) {
670 * @param startIndex The starting position of the "X-Wap-Content-URI" in this pdu
676 public boolean decodeXWapContentURI(int startIndex) {
677 return decodeTextString(startIndex);
683 * @param startIndex The starting position of the "X-Wap-Initiator-URI" in this pdu
689 public boolean decodeXWapInitiatorURI(int startIndex) {
690 return decodeTextString(startIndex);