org.jsmpp
Class DefaultPDUReader

java.lang.Object
  extended by org.jsmpp.DefaultPDUReader
All Implemented Interfaces:
PDUReader

public class DefaultPDUReader
extends java.lang.Object
implements PDUReader

Default implementation of PDUReader.

Since:
1.0
Version:
1.0
Author:
uudashr

Constructor Summary
DefaultPDUReader()
           
 
Method Summary
 byte[] readPDU(java.io.DataInputStream in, Command pduHeader)
          Read all smpp pdu (excluding the command header) with specified pdu header.
 byte[] readPDU(java.io.DataInputStream in, int commandLength, int commandId, int commandStatus, int sequenceNumber)
          Read all smpp pdu (excluding the command header) with specified pdu header values.
 Command readPDUHeader(java.io.DataInputStream in)
          Read the pdu header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPDUReader

public DefaultPDUReader()
Method Detail

readPDUHeader

public Command readPDUHeader(java.io.DataInputStream in)
                      throws InvalidCommandLengthException,
                             java.io.IOException
Description copied from interface: PDUReader
Read the pdu header. If command length to short, we will read the left bytes anyway, and throw InvalidCommandLengthException

Specified by:
readPDUHeader in interface PDUReader
Parameters:
in - is the input stream of the pdu.
Returns:
the header of smpp command.
Throws:
InvalidCommandLengthException - if command_length is to short.
java.io.IOException - if an I/O error occurs.

readPDU

public byte[] readPDU(java.io.DataInputStream in,
                      Command pduHeader)
               throws java.io.IOException
Description copied from interface: PDUReader
Read all smpp pdu (excluding the command header) with specified pdu header.

Specified by:
readPDU in interface PDUReader
Parameters:
in - is input stream of the pdu (the source).
pduHeader - is the pdu header.
Returns:
the complete byte of smpp command.
Throws:
java.io.IOException - if an I/O error occurs.

readPDU

public byte[] readPDU(java.io.DataInputStream in,
                      int commandLength,
                      int commandId,
                      int commandStatus,
                      int sequenceNumber)
               throws java.io.IOException
Description copied from interface: PDUReader
Read all smpp pdu (excluding the command header) with specified pdu header values.

Specified by:
readPDU in interface PDUReader
Parameters:
in - is the input stream of the pdu (the source).
commandLength - is the command length of smpp pdu command.
commandId - is id of smpp command.
commandStatus - is status of smpp command.
sequenceNumber - is sequence number of smpp command.
Returns:
the complete byte of smpp command.
Throws:
java.io.IOException - if an I/O error occurs.