Lines Matching refs:pdu
73 for (byte[] pdu : pdus) {
74 Pair<String, String> p = parseBody(header, pdu);
107 * @param pdu the PDU to decode
110 private static Pair<String, String> parseBody(SmsCbHeader header, byte[] pdu) {
186 int nrPages = pdu[SmsCbHeader.PDU_HEADER_LENGTH];
188 if (pdu.length < SmsCbHeader.PDU_HEADER_LENGTH + 1 + (PDU_BODY_PAGE_LENGTH + 1)
190 throw new IllegalArgumentException("Pdu length " + pdu.length + " does not match "
200 int length = pdu[offset + PDU_BODY_PAGE_LENGTH];
207 Pair<String, String> p = unpackBody(pdu, encoding, offset, length,
216 int length = pdu.length - offset;
218 return unpackBody(pdu, encoding, offset, length, hasLanguageIndicator, language);
223 * Unpack body text from the pdu using the given encoding, position and
224 * length within the pdu
226 * @param pdu The pdu
236 private static Pair<String, String> unpackBody(byte[] pdu, int encoding, int offset, int length,
242 body = GsmAlphabet.gsm7BitPackedToString(pdu, offset, length * 8 / 7);
253 if (hasLanguageIndicator && pdu.length >= offset + 2) {
256 language = GsmAlphabet.gsm7BitPackedToString(pdu, offset, 2);
262 body = new String(pdu, offset, (length & 0xfffe), "utf-16");