public class SynchronizedPDUReader extends java.lang.Object implements PDUReader
PDUReader
that use synchronize when
accessing to the InputStream
or DataInputStream
tha used to
read the PDU.Constructor and Description |
---|
SynchronizedPDUReader()
Default constructor.
|
SynchronizedPDUReader(PDUReader pduReader)
Construct with specified pdu reader.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
readPDU(java.io.InputStream in,
Command pduHeader)
Read all smpp pdu (excluding the command header) with specified pdu
header.
|
byte[] |
readPDU(java.io.InputStream 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.
|
public SynchronizedPDUReader()
public SynchronizedPDUReader(PDUReader pduReader)
pduReader
- is the pdu reader.public byte[] readPDU(java.io.InputStream in, Command pduHeader) throws java.io.IOException
PDUReader
public byte[] readPDU(java.io.InputStream in, int commandLength, int commandId, int commandStatus, int sequenceNumber) throws java.io.IOException
PDUReader
readPDU
in interface PDUReader
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.java.io.IOException
- if an I/O error occurs.public Command readPDUHeader(java.io.DataInputStream in) throws InvalidCommandLengthException, java.io.IOException
PDUReader
InvalidCommandLengthException
readPDUHeader
in interface PDUReader
in
- is the input stream of the pdu.InvalidCommandLengthException
- if command_length is to short.java.io.IOException
- if an I/O error occurs.