|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.onionnetworks.fec.FECCode
public abstract class FECCode
This class provides the main API/SPI for the FEC library. You cannot
construct an FECCode directly, rather you must use an FECCodeFactory.
For example:
int k = 32;
int n = 256;
FECCode code = FECCodeFactory.getDefault().createFECCode(k,n);
All FEC
implementations will sublcass FECCode and implement the encode/decode
methods. All codes implemented by this interface are assumed to be
systematic codes which means that the first k repair packets will be
the same as the original source packets.
(c) Copyright 2001 Onion Networks
(c) Copyright 2000 OpenCola
Method Summary | |
---|---|
void |
decode(com.onionnetworks.util.Buffer[] pkts,
int[] index)
This method takes an array of encoded packets and decodes them. |
void |
encode(com.onionnetworks.util.Buffer[] src,
com.onionnetworks.util.Buffer[] repair,
int[] index)
This method takes an array of source packets and generates a number of repair packets from them. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void encode(com.onionnetworks.util.Buffer[] src, com.onionnetworks.util.Buffer[] repair, int[] index)
src
- An array of k
Buffers that contain the source
packets to be encoded. Often these Buffers are actually references
to a single byte[] that contains the entire source block.repair
- Much like src, variable points to a number of Buffers
to which the encoded repair packets will be written. This array should
be the same length as index.index
- This int[] specifies the indexes of the packets to be
encoded and written to repair
. These indexes must be
between 0..n (should probably be k..n, because encoding < k is a NOP)public void decode(com.onionnetworks.util.Buffer[] pkts, int[] index)
pkts
- An array of k
Buffers that contain the repair
packets to be decoded. The decoding proceedure will copy the decoded
data into the Buffers that are provided and will place them in order
within the Buffer[]. If the Buffers are already properly shuffled
then no data will be copied around during the shuffle proceedure.index
- This int[] specifies the indexes of the packets to be
decoded. These indexes must be between 0..n
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |