public class FecEncoder extends Object
Date: April 13, 2005 Time: 1057:29 Author: Terry Norbraten Comments: New Date: April 20, 2005 Time: 1220:22 Author: Terry Norbraten Comments: Modified to send *.xsbc.gz file length to the FEC Decoder for FEC Parameter instantiation on that end. Date: April 30, 2005 Time: 1349:46 Author: Terry Norbraten Comments: Modified to manually encode a selected file for demo purposes. Modified constructor to accept an AUV (execution) instance so that vehicle runtimeFlags can be read to set FEC parameters. Added default (no argument) constructor to handle manual FECFile encoding. This can not be called from the xsbc1.4.jar due to these modifications. Date: May 18, 2005 Time: 1224:32 Author: Terry Norbraten Comments: Closed open streams in setIntegrityTable() Date: June 11, 2006 Time: 1752 Author: Terry Norbraten Comments: Replaced Utilities.traceOuts with log4j statements
Constructor and Description |
---|
FecEncoder()
Default constructor
|
FecEncoder(Execution vehicle)
Creates a new instance of FecEncoder
|
Modifier and Type | Method and Description |
---|---|
void |
createAndSendFECFile()
Performs FEC encoding of an already saved to disc *.xsbc.gz file before
sending via UDP over the net.
|
void |
createManualFECFile()
Performs manual FEC encoding of a chosen file
|
int[] |
getEntireIndiceArray()
Convenience method for retrieving the entire repair packets indice array
for an FEC file
|
com.onionnetworks.fec.io.FECParameters |
getFECParameters()
Returns FEC Parameters
|
String |
getHost()
Retrieve the host to send FEC Encoded files to
|
File |
getInFile()
Retrieves the incoming *.xml file for encoding
|
com.onionnetworks.util.FileIntegrity |
getIntegrityTable()
Retrieves the integrity MD5 hash set of the file about to be encoded
|
File |
getOutFile()
Retrievs the *.xsbc.gz file for encoding
|
int |
getPort()
Retrieve the port # to send FEC Encoded files to
|
com.onionnetworks.util.Buffer[] |
getSourceBufferK()
Convenience method for retrieving a Buffer[]
|
static void |
main(String[] args)
Command line entry point for this class/program
|
void |
sendFECHeaderInfo()
Initiates all of the required UDP preparations and transmits the FEC
encoded file to the FEC Decoder
|
void |
setEntireIndiceArray(int bc,
int[] ri)
Convenience method for setting the entire repair packets indice array
for an FEC file
|
void |
setFECParameters(long fileLength)
Creates FECParameters that the encoding process will need for encoding.
|
void |
setHost(String host)
Set the host for sending FEC Encoded files
|
void |
setInFile(File file)
Sets the incoming *.xml file for encoding
|
void |
setIntegrityTable()
Creates the file ingerity table which is sent to the FEC decoder for
file integrity verification upon decoding a transmitted FEC encoded file
|
void |
setOutFile(File file)
Sets the out going *.xsbc.gz file for encoding
|
void |
setPort(int port)
Set the port number for sending FEC Encoded files
|
void |
setSourceBufferK(com.onionnetworks.util.Buffer[] sb)
Convenience method for setting a Buffer[]
|
public FecEncoder()
public FecEncoder(Execution vehicle)
vehicle
- a particular vehicle's execution parameterspublic void sendFECHeaderInfo()
public void createAndSendFECFile()
public void createManualFECFile()
public void setHost(String host)
host
- the host to send topublic String getHost()
public void setPort(int port)
port
- the port number to connect topublic int getPort()
public void setInFile(File file)
file
- the *.xml file to encodepublic File getInFile()
public void setOutFile(File file)
file
- the *.xsbc.gz file to encodepublic File getOutFile()
public void setIntegrityTable()
public com.onionnetworks.util.FileIntegrity getIntegrityTable()
public void setFECParameters(long fileLength)
fileLength
- the length of the XSBC file to encodepublic com.onionnetworks.fec.io.FECParameters getFECParameters()
public void setEntireIndiceArray(int bc, int[] ri)
bc
- block count for each generated indice array in that blockri
- the K repair indice array for each blockpublic int[] getEntireIndiceArray()
public void setSourceBufferK(com.onionnetworks.util.Buffer[] sb)
sb
- the Buffer[] to setpublic com.onionnetworks.util.Buffer[] getSourceBufferK()
public static void main(String[] args)
args
- the command line arguments if any