Skip to content

Commit

Permalink
Remove the streaming example for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed Oct 27, 2015
1 parent 64a2a9b commit 2708e36
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions streaming_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package reedsolomon

import (
"bytes"
"fmt"
"io"
"io/ioutil"
"math/rand"
Expand Down Expand Up @@ -528,44 +527,6 @@ func BenchmarkStreamVerify10x4x16M(b *testing.B) {
benchmarkStreamVerify(b, 10, 4, 16*1024*1024)
}

// Simple example of how to use all functions of the Encoder.
// Note that all error checks have been removed to keep it short.
// FIXME: Actually use NewStream
func ExampleStreamEncoder() {
// Create some sample data
var data = make([]byte, 250000)
fillRandom(data)

// Create an encoder with 17 data and 3 parity slices.
enc, _ := New(17, 3)

// Split the data into shards
shards, _ := enc.Split(data)

// Encode the parity set
_ = enc.Encode(shards)

// Verify the parity set
ok, _ := enc.Verify(shards)
if ok {
fmt.Println("ok")
}

// Delete two shards
shards[10], shards[11] = nil, nil

// Reconstruct the shards
_ = enc.Reconstruct(shards)

// Verify the data set
ok, _ = enc.Verify(shards)
if ok {
fmt.Println("ok")
}
// Output: ok
// ok
}

func TestStreamSplitJoin(t *testing.T) {
var data = make([]byte, 250000)
rand.Seed(0)
Expand Down

0 comments on commit 2708e36

Please sign in to comment.