public class FragmentContainer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
FragmentContainer(byte[] id,
int numberoffrags)
Constructor
Build a new Fragment Container with id of the message to reassemble
and numberoffrags needed packets to reassemble
|
Modifier and Type | Method and Description |
---|---|
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
|
private byte[] m_id
private int FRAGSIZE
private byte[][] m_fragments
private boolean m_readytoreassemble
private int m_counter
private int[] m_indizes
private int m_numberoffrags
private boolean[] m_add
public FragmentContainer(byte[] id, int numberoffrags)
id
- numberoffrags
- public boolean addFragment(byte[] frag, int index)
frag
- index
- public byte[] getID()
public byte[] reassembleMessage()
Copyright © 2023. All rights reserved.