Package com.reve.reed.solomon.sample
Class SampleEncoder
java.lang.Object
com.reve.reed.solomon.sample.SampleEncoder
Command-line program encodes one file using Reed-Solomon 4+2.
The one argument should be a file name, say "foo.txt". This program
will create six files in the same directory, breaking the input file
into four data shards, and two parity shards. The output files are
called "foo.txt.0", "foo.txt.1", ..., and "foo.txt.5". Numbers 4
and 5 are the parity shards.
The data stored is the file size (four byte int), followed by the
contents of the file, and then padded to a multiple of four bytes
with zeros. The padding is because all four data shards must be
the same size.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
DATA_SHARDS
public static final int DATA_SHARDS- See Also:
-
PARITY_SHARDS
public static final int PARITY_SHARDS- See Also:
-
TOTAL_SHARDS
public static final int TOTAL_SHARDS- See Also:
-
BYTES_IN_INT
public static final int BYTES_IN_INT- See Also:
-
-
Constructor Details
-
SampleEncoder
public SampleEncoder()
-
-
Method Details
-
main
- Throws:
IOException
-