Home | History | Annotate | Download | only in bufio

Lines Matching refs:Writer

5 // Package bufio implements buffered I/O.  It wraps an io.Reader or io.Writer
6 // object, creating another object (Reader or Writer) that also implements
461 func (b *Reader) WriteTo(w io.Writer) (n int64, err error) {
500 var errNegativeWrite = errors.New("bufio: writer returned negative count from Write")
502 // writeBuf writes the Reader's buffer to the writer.
503 func (b *Reader) writeBuf(w io.Writer) (int64, error) {
514 // Writer implements buffering for an io.Writer object.
515 // If an error occurs writing to a Writer, no more data will be
519 // the underlying io.Writer.
520 type Writer struct {
524 wr io.Writer
527 // NewWriterSize returns a new Writer whose buffer has at least the specified
528 // size. If the argument io.Writer is already a Writer with large enough
529 // size, it returns the underlying Writer.
530 func NewWriterSize(w io.Writer, size int) *Writer {
531 // Is it already a Writer?
532 b, ok := w.(*Writer)
539 return &Writer{
545 // NewWriter returns a new Writer whose buffer has the default size.
546 func NewWriter(w io.Writer) *Writer {
552 func (b *Writer) Reset(w io.Writer) {
558 // Flush writes any buffered data to the underlying io.Writer.
559 func (b *Writer) Flush() error {
583 func (b *Writer) Available() int { return len(b.buf) - b.n }
586 func (b *Writer) Buffered() int { return b.n }
592 func (b *Writer) Write(p []byte) (nn int, err error) {
617 func (b *Writer) WriteByte(c byte) error {
631 func (b *Writer) WriteRune(r rune) (size int, err error) {
662 Writer) WriteString(s string) (int, error) {
681 func (b *Writer) ReadFrom(r io.Reader) (n int64, err error) {
724 // ReadWriter stores pointers to a Reader and a Writer.
728 *Writer
732 func NewReadWriter(r *Reader, w *Writer) *ReadWriter {