private static short encodeSequenceNumber(int sequenceNumber) throws SequenceNumberOutOfRangeException {
		if(sequenceNumber != Packet.SEQUENCE_NUMBER_NOT_APPLICABLE && (sequenceNumber < Packet.MINIMUM_SEQUENCE_NUMBER || sequenceNumber > Packet.MAXIMUM_SEQUENCE_NUMBER))
			throw new SequenceNumberOutOfRangeException(sequenceNumber);
		return (short) (sequenceNumber > Short.MAX_VALUE ? sequenceNumber + 2*Short.MIN_VALUE : sequenceNumber);
	}