* (non-Javadoc)
*
* @see org.jsmpp.util.PDUDecomposer#deliverSm(byte[])
*/
public DeliverSm deliverSm(byte[] b) throws PDUStringException {
DeliverSm req = new DeliverSm();
SequentialBytesReader reader = new SequentialBytesReader(b);
assignHeader(req, reader);
req.setServiceType(reader.readCString());
StringValidator.validateString(req.getServiceType(),
StringParameter.SERVICE_TYPE);
req.setSourceAddrTon(reader.readByte());
req.setSourceAddrNpi(reader.readByte());
req.setSourceAddr(reader.readCString());
StringValidator.validateString(req.getSourceAddr(),
StringParameter.SOURCE_ADDR);
req.setDestAddrTon(reader.readByte());
req.setDestAddrNpi(reader.readByte());
req.setDestAddress(reader.readCString());
StringValidator.validateString(req.getDestAddress(),
StringParameter.DESTINATION_ADDR);
req.setEsmClass(reader.readByte());
req.setProtocolId(reader.readByte());
req.setPriorityFlag(reader.readByte());
// scheduleDeliveryTime should be null of c-octet string
req.setScheduleDeliveryTime(reader.readCString());
StringValidator.validateString(req.getScheduleDeliveryTime(),
StringParameter.SCHEDULE_DELIVERY_TIME);
// validityPeriod should be null of c-octet string
req.setValidityPeriod(reader.readCString());
StringValidator.validateString(req.getValidityPeriod(),
StringParameter.VALIDITY_PERIOD);
req.setRegisteredDelivery(reader.readByte());
// replaceIfPresent should be null
req.setReplaceIfPresent(reader.readByte());
req.setDataCoding(reader.readByte());
// smDefaultMsgId should be null
req.setSmDefaultMsgId(reader.readByte());
byte smLength = reader.readByte();
req.setShortMessage(reader.readBytes(smLength));
StringValidator.validateString(req.getShortMessage(),
StringParameter.SHORT_MESSAGE);
req.setOptionalParameters(readOptionalParameters(reader));
return req;
}