Documentation ¶
Index ¶
Constants ¶
View Source
const EOFReader = eofreader(0)
EOFReader is an io.Reader with Read always giving an io.EOF.
Variables ¶
This section is empty.
Functions ¶
func Drain ¶
Drain reads from r until either io.EOF is reached on r or an error occurs. It returns the number of bytes read and the first error encountered while reading, if any. Note that on completing successful drain the second return value is nil and not io.EOF. Because Drain is defined to read from r until io.EOF, it does not treat an io.EOF from Read as an error to be reported.
Types ¶
type ByteCountWriter ¶
type ByteCountWriter struct { W io.Writer // The wrapped writer N int64 // The number of bytes written to the writer }
ByteCountWriter wraps an io.Writer and keeps track of the number of bytes that have been written to the wrapped writer.
func (*ByteCountWriter) Size ¶
func (w *ByteCountWriter) Size() int64
Size returns the number of bytes that have been written to the writer.
Click to show internal directories.
Click to hide internal directories.