2020-08-14 14:06:53 +00:00
|
|
|
package sealing
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
2020-08-21 08:52:33 +00:00
|
|
|
nr "github.com/filecoin-project/lotus/extern/storage-sealing/lib/nullreader"
|
2020-08-14 14:06:53 +00:00
|
|
|
"github.com/filecoin-project/specs-actors/actors/abi"
|
|
|
|
)
|
|
|
|
|
|
|
|
type NullReader struct {
|
|
|
|
*io.LimitedReader
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewNullReader(size abi.UnpaddedPieceSize) io.Reader {
|
|
|
|
return &NullReader{(io.LimitReader(&nr.Reader{}, int64(size))).(*io.LimitedReader)}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m NullReader) NullBytes() int64 {
|
|
|
|
return m.N
|
2020-08-16 09:42:13 +00:00
|
|
|
}
|