public ByteBuffer getBody() { ByteBuffer buffer = new ByteBuffer(); buffer.appendCString(getServiceType()); buffer.appendBuffer(getSourceAddr().getData()); buffer.appendBuffer(getDestAddr().getData()); buffer.appendByte(getEsmClass()); buffer.appendByte(getProtocolId()); buffer.appendByte(getPriorityFlag()); buffer.appendCString(getScheduleDeliveryTime()); buffer.appendCString(getValidityPeriod()); buffer.appendByte(getRegisteredDelivery()); buffer.appendByte(getReplaceIfPresentFlag()); buffer.appendByte(getDataCoding()); buffer.appendByte(getSmDefaultMsgId()); buffer.appendByte(encodeUnsigned(getSmLength())); buffer.appendBuffer(shortMessage.getData()); return buffer; }
public void setBody(ByteBuffer buffer) throws NotEnoughDataInByteBufferException, TerminatingZeroNotFoundException, PDUException { setServiceType(buffer.removeCString()); sourceAddr.setData(buffer); // ? destAddr.setData(buffer); // ? setEsmClass(buffer.removeByte()); setProtocolId(buffer.removeByte()); setPriorityFlag(buffer.removeByte()); setScheduleDeliveryTime(buffer.removeCString()); setValidityPeriod(buffer.removeCString()); setRegisteredDelivery(buffer.removeByte()); setReplaceIfPresentFlag(buffer.removeByte()); setDataCoding(buffer.removeByte()); setSmDefaultMsgId(buffer.removeByte()); setSmLength(decodeUnsigned(buffer.removeByte())); shortMessage.setData(buffer.removeBuffer(getSmLength())); }