anon.mixminion.message
Class FragmentContainer
java.lang.Object
anon.mixminion.message.FragmentContainer
public class FragmentContainer
- extends java.lang.Object
- Author:
- Stefan Roenisch
Constructor Summary |
FragmentContainer(byte[] id,
int numberoffrags)
Constructor
Build a new Fragment Container with id of the message to reassemble
and numberoffrags needed packets to reassemble |
Method Summary |
boolean |
addFragment(byte[] frag,
int index)
Adds a Fragment with specified Index
returns true if enough packets are in the container to reassemble |
byte[] |
getID()
return the id of the container/message |
byte[] |
reassembleMessage()
reassembles the message if possible,
return null if impossible, otherwise a bytearray containing
the whitened, compressed, padded message |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_id
private byte[] m_id
FRAGSIZE
private int FRAGSIZE
m_fragments
private byte[][] m_fragments
m_readytoreassemble
private boolean m_readytoreassemble
m_counter
private int m_counter
m_indizes
private int[] m_indizes
m_numberoffrags
private int m_numberoffrags
m_add
private boolean[] m_add
FragmentContainer
public FragmentContainer(byte[] id,
int numberoffrags)
- Constructor
Build a new Fragment Container with id of the message to reassemble
and numberoffrags needed packets to reassemble
- Parameters:
id
- numberoffrags
-
addFragment
public boolean addFragment(byte[] frag,
int index)
- Adds a Fragment with specified Index
returns true if enough packets are in the container to reassemble
- Parameters:
frag
- index
-
- Returns:
getID
public byte[] getID()
- return the id of the container/message
- Returns:
reassembleMessage
public byte[] reassembleMessage()
- reassembles the message if possible,
return null if impossible, otherwise a bytearray containing
the whitened, compressed, padded message
- Returns: