remove BufferedReader.Direct

This commit is contained in:
Darien Raymond
2018-08-17 20:45:23 +02:00
parent 1b39199adf
commit 2e11653694
5 changed files with 0 additions and 14 deletions
-8
View File
@@ -90,8 +90,6 @@ type BufferedReader struct {
Reader Reader
// Buffer is the internal buffer to be read from first
Buffer MultiBuffer
// Direct indicates whether or not to use the internal buffer
Direct bool
}
// BufferedBytes returns the number of bytes that is cached in this reader.
@@ -118,12 +116,6 @@ func (r *BufferedReader) Read(b []byte) (int, error) {
return nBytes, nil
}
if r.Direct {
if reader, ok := r.Reader.(io.Reader); ok {
return reader.Read(b)
}
}
mb, err := r.Reader.ReadMultiBuffer()
if err != nil {
return 0, err
-1
View File
@@ -104,7 +104,6 @@ func NewAuthenticationReader(auth Authenticator, sizeParser ChunkSizeDecoder, re
sizeBytes: make([]byte, sizeParser.SizeBytes()),
}
if breader, ok := reader.(*buf.BufferedReader); ok {
breader.Direct = false
r.reader = breader
} else {
r.reader = &buf.BufferedReader{Reader: buf.NewReader(reader)}