Represents a reassembly engine that takes in a number of small fragment byte arrays generated by a Fragmenter, and reassembles the large byte array that the fragments were generated from.
| Type Params | Return Type | Name and description |
|---|---|---|
|
int |
addFragment(byte[] fragment)Adds a fragment for reassembly. |
|
byte[] |
getData()Gets the reassembled data, if reassembly is complete. |
|
long |
getDataLength()Gets length of the data array to reassemble. |
|
int |
getFragmentCount()Gets the number of fragments successfully added during reassembly. |
|
int |
getFragmentLength()Gets length of each fragment. |
|
int |
getMaxFragmentCount()Gets the maximum number of fragments possible. |
|
int |
getMinFragmentCount()Gets the minimum number of fragments required to reassemble the data. |
|
boolean |
hasFinishedReassembly()Checks if the reassemble is complete. |
|
Reassembler |
setup(long dataLen, int fragmentLen)Sets up the reassembler to reassemble a large data chunk from smaller fragments of a specified length. |
Adds a fragment for reassembly. A fragment may fail to be added if the reassembly is already complete, or if the fragment is malformed.
Gets the reassembled data, if reassembly is complete.
Gets length of the data array to reassemble.
Gets the number of fragments successfully added during reassembly.
Gets length of each fragment.
Gets the maximum number of fragments possible.
Gets the minimum number of fragments required to reassemble the data.
Checks if the reassemble is complete.
Sets up the reassembler to reassemble a large data chunk from smaller fragments of a specified length.
dataLen - length of the large data chuck to be reconstructed.fragmentLen - size of each fragment in bytes.