public class NoSplitMessageSplitter extends Object implements MessageSplitter
It always returns a single segment with the whole message.
The message is encoded using the provided Encoder
. The
Encoder
may be null and the result segment wraps the unencoded
original string.
Constructor and Description |
---|
NoSplitMessageSplitter()
Initializes with no encoder.
|
NoSplitMessageSplitter(Encoder encoder)
Initializes with the
Encoder used to encode the string message
into a byte array. |
Modifier and Type | Method and Description |
---|---|
List<Segment> |
split(String message)
If the message is too long and can't fit in a single SMS, the message has
to be split into several segments.
|
public NoSplitMessageSplitter()
public NoSplitMessageSplitter(Encoder encoder)
Encoder
used to encode the string message
into a byte array.
The encoder may be null, resulting in a single segment with the unencoded original string.
encoder
- the encoder used to encode the messagepublic List<Segment> split(String message) throws SplitMessageException
MessageSplitter
If the whole message can fit in a single SMS, the result is a list of one segment with the whole message.
If the whole message can't fit in a single SMS, the message is split into several segments. Each segment contains a part of the message. In addition to part of the message, the segment may contain some bytes that are used as a header (see User Data Header).
split
in interface MessageSplitter
message
- the message that may need to be splitSplitMessageException
- when message couldn't be splitCopyright © 2021. All rights reserved.