public class OtrFragmenter extends Object
| Constructor and Description |
|---|
OtrFragmenter(Session session,
OtrEngineHost host)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String[] |
fragment(String message)
Fragment the given message into pieces as specified by the
FragmenterInstructions instance.
|
OtrEngineHost |
getHost()
Get instructions for fragmentation behaviour.
|
int |
numberOfFragments(String message)
Calculate the number of fragments that are required for the message to be
sent fragmented completely.
|
public OtrFragmenter(Session session, OtrEngineHost host)
session - session instance (cannot be null)host - OTR engine host calling upon OTR sessionpublic OtrEngineHost getHost()
public int numberOfFragments(String message) throws IOException
message - the original messageIOException - throws an IOException in case fragment size is too small to
store any content or when the provided policy does not
support fragmentation, for example if only OTRv1 is allowed.public String[] fragment(String message) throws IOException
message - the original messageIOException - throws an IOException if the fragment size is too small or if
the maximum number of fragments is exceeded.Copyright © 2015. All rights reserved.