public class IMCFragmentHandler
extends java.lang.Object
Constructor and Description |
---|
IMCFragmentHandler(IMCDefinition definitions) |
Modifier and Type | Method and Description |
---|---|
MessagePart[] |
fragment(IMCMessage message,
int maxFragLength)
Fragment a message into smaller MessagePart's
|
IMCMessage |
reassemble(java.util.List<MessagePart> parts)
Given a list of message fragments try to reassemble the fragments into an IMCMessage
|
IMCMessage |
setFragment(MessagePart fragment)
Add an incoming fragment
|
public IMCFragmentHandler(IMCDefinition definitions)
public IMCMessage setFragment(MessagePart fragment)
fragment
- The fragment to add to the list of incoming fragmentsnull
if this is not the last
fragment.public IMCMessage reassemble(java.util.List<MessagePart> parts) throws java.lang.Exception
parts
- The fragments to processjava.lang.Exception
- In case the fragments do not result in a valid messagepublic MessagePart[] fragment(IMCMessage message, int maxFragLength) throws java.lang.Exception
message
- The message to be fragmentedmaxFragLength
- The maximum size of any generated MessagePart. Must be greater than 25.java.lang.Exception
- In case the message cannot be fragmented