Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## reedSolomon
Class ReedSolomonLocal

    java.lang.Object
      reedSolomon.ReedSolomonLocal

    public class ReedSolomonLocal

extends java.lang.Object

Implements ReedSolomon code. Basic idea of class is to compute checksums to already existing fragments. These checksums can be later used to restore original files. All files must be of same size. This is fan in implementation of Reed-Solomon algorithm. All checksums are calculated centraly and can be distributed to hosts later.

Constructor Summary
`ReedSolomonLocal()`

Method Summary
`static void` | `calculateChecksums(java.lang.Iterable<java.io.InputStream> ins, java.lang.Iterable<java.io.OutputStream> outs, int m)` This method reads input streams from passed iterator to get bytes of data which are in turn used to calculate checksum files written into output streams from outputstream iterator.
`static void` | `calculateChecksums(java.lang.Iterable<java.io.InputStream> ins, java.lang.Iterable<java.io.OutputStream> outs, int m, int w)` This method reads input streams from passed iterator to get bytes of data which are in turn used to calculate checksum files written into output streams from outputstream iterator.
`static void` | `recover(java.lang.Iterable<java.io.InputStream> ins, java.lang.Iterable<java.io.OutputStream> outs, int n, int m)` This method reads input streams and if any of first n streams is missing, it is calculated and written into corresponding outputstream.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ReedSolomonLocal

    public ReedSolomonLocal()

Method Detail

### calculateChecksums

    public static void calculateChecksums(java.lang.Iterable<java.io.InputStream> ins,
                                          java.lang.Iterable<java.io.OutputStream> outs,
                                          int m)

  This method reads input streams from passed iterator to get bytes of data which are in turn used to calculate checksum files written into output streams from outputstream iterator. Default size of finite field of 2^16 is used.

  Parameters:
    `ins` - Iterable over inputstreams
    `outs` - Iterable over outputstreams
    `m` - number of checksums to calculate

### calculateChecksums

    public static void calculateChecksums(java.lang.Iterable<java.io.InputStream> ins,
                                          java.lang.Iterable<java.io.OutputStream> outs,
                                          int m,
                                          int w)

  This method reads input streams from passed iterator to get bytes of data which are in turn used to calculate checksum files written into output streams from outputstream iterator. Size of finite field of 2^w is used, where w is argument passed to function.

  Parameters:
    `ins` - Iterable over inputstreams
    `outs` - Iterable over outputstreams
    `m` - number of checksums to calculate
    `w` - used to set size of finite field

### recover

    public static void recover(java.lang.Iterable<java.io.InputStream> ins,
                               java.lang.Iterable<java.io.OutputStream> outs,
                               int n,
                               int m)
                        throws java.lang.Exception

  This method reads input streams and if any of first n streams is missing, it is calculated and written into corresponding outputstream.

  Parameters:
    `ins` -
    `outs` -
    `n` -
    `m` -
  Throws:
    `java.io.IOException`
    `java.lang.Exception`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD