/* (non-Javadoc)
* @see org.jsmpp.PDUReader#readPDUHeader(java.io.DataInputStream)
*/
public Command readPDUHeader(DataInputStream in)
throws InvalidCommandLengthException, IOException {
Command header = new Command();
header.setCommandLength(in.readInt());
if (header.getCommandLength() < 16) {
// command length to short, read the left dump anyway
byte[] dump = new byte[header.getCommandLength()];
in.read(dump, 4, header.getCommandLength() - 4);
throw new InvalidCommandLengthException("Command length "
+ header.getCommandLength() + " is to short");
}
header.setCommandId(in.readInt());
header.setCommandStatus(in.readInt());
header.setSequenceNumber(in.readInt());
return header;
}