anon.mixminion.message
Class FragmentContainer

java.lang.Object
  extended by anon.mixminion.message.FragmentContainer

public class FragmentContainer
extends java.lang.Object

Author:
Stefan Roenisch

Field Summary
private  int FRAGSIZE
           
private  boolean[] m_add
           
private  int m_counter
           
private  byte[][] m_fragments
           
private  byte[] m_id
           
private  int[] m_indizes
           
private  int m_numberoffrags
           
private  boolean m_readytoreassemble
           
 
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
 

Field Detail

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
Constructor Detail

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 -
Method Detail

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: