Documentation ¶
Index ¶
- func TransferDataWithSplitReadAndWrites(dest ByteBlockWriter, nBytesToRead int, r ByteReadReader, ...) (singleByteReads int, blockReads int, bytesBlockReads int, n int, err error)
- type ByteBlockDiscardReader
- type ByteBlockWriter
- type ByteReadReader
- type BytesBlockByteReadReader
- type DeferredTee
- func (inst *DeferredTee) Discard(n int) (int, error)
- func (inst *DeferredTee) DiscardAndFlush(n int) (nWritten int, err error)
- func (inst *DeferredTee) Flush() (int, error)
- func (inst *DeferredTee) Peek(n int) ([]byte, error)
- func (inst *DeferredTee) Read(p []byte) (n int, err error)
- func (inst *DeferredTee) ReadByte() (b byte, err error)
- type SizeMeasureWriter
- type TeeByteReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TransferDataWithSplitReadAndWrites ¶
func TransferDataWithSplitReadAndWrites(dest ByteBlockWriter, nBytesToRead int, r ByteReadReader, maxConsecutiveBytesToRead int, ra *rand.Rand) (singleByteReads int, blockReads int, bytesBlockReads int, n int, err error)
TransferDataWithSplitReadAndWrites copies nBytesToRead from r to dest by randomly using io.Reader and io.ByteReader interface. The number of bytes transferred by each method is roughly balanced.
Types ¶
type ByteBlockDiscardReader ¶
type ByteBlockDiscardReader interface { ByteReadReader Discard(n int) (int, error) }
func NewByteBlockReaderDiscardReader ¶
func NewByteBlockReaderDiscardReader(reader interface{}) (ByteBlockDiscardReader, error)
type ByteBlockWriter ¶
type ByteBlockWriter interface { io.ByteWriter io.Writer }
type ByteReadReader ¶
type ByteReadReader interface { io.Reader io.ByteReader }
type BytesBlockByteReadReader ¶
type BytesBlockByteReadReader struct {
// contains filtered or unexported fields
}
func NewBytesBlockByteReadReader ¶
func NewBytesBlockByteReadReader(r ByteReadReader) *BytesBlockByteReadReader
func (*BytesBlockByteReadReader) Discard ¶
func (inst *BytesBlockByteReadReader) Discard(n int) (nBytesRead int, err error)
func (*BytesBlockByteReadReader) Read ¶
func (inst *BytesBlockByteReadReader) Read(p []byte) (n int, err error)
func (*BytesBlockByteReadReader) ReadByte ¶
func (inst *BytesBlockByteReadReader) ReadByte() (byte, error)
type DeferredTee ¶
type DeferredTee struct {
// contains filtered or unexported fields
}
func NewDeferredTee ¶
func (*DeferredTee) Discard ¶
func (inst *DeferredTee) Discard(n int) (int, error)
Discard needs buffering, use DiscardAndFlush to stream directly to output
func (*DeferredTee) DiscardAndFlush ¶
func (inst *DeferredTee) DiscardAndFlush(n int) (nWritten int, err error)
func (*DeferredTee) Flush ¶
func (inst *DeferredTee) Flush() (int, error)
func (*DeferredTee) ReadByte ¶
func (inst *DeferredTee) ReadByte() (b byte, err error)
type SizeMeasureWriter ¶
type SizeMeasureWriter struct {
Size uint64
}
func (*SizeMeasureWriter) Reset ¶
func (inst *SizeMeasureWriter) Reset()
type TeeByteReader ¶
type TeeByteReader struct {
// contains filtered or unexported fields
}
func NewTeeByteReader ¶
func NewTeeByteReader(r ByteReadReader, w ByteBlockWriter) *TeeByteReader
func (*TeeByteReader) ReadByte ¶
func (t *TeeByteReader) ReadByte() (b byte, err error)
Click to show internal directories.
Click to hide internal directories.