// NewReadWriter wraps an io.ReadWriter with a msgio.ReadWriter. Writing
// and Reading will be appropriately framed.
420757
func NewReadWriter(rw io.ReadWriter) ReadWriteCloser {
	return &readWriter{
		Reader: NewReader(rw),
		Writer: NewWriter(rw),
	}
}
54484
func NewErrWriter(w io.Writer) io.Writer {
	return errWriter{ansiterm.NewWriter(w)}
}
1146069
func (e Encoder) NewWriter(wr io.Writer) *Writer {
	w := new(Writer)
	w.wr = wr
	w.encode = e
	return w
}
1280235
func NewWriter(w io.Writer, bo binary.ByteOrder) Writer {
	return &writer{
		w:  w,
		bo: bo,
	}
}
166346
func NewWriter(dir string) (*Writer, error) {
	if err := os.MkdirAll(dir, 0777); err != nil {
		return nil, err
	}
	dirFile, err := fileutil.OpenDir(dir)
	if err != nil {
		return nil, err
	}
	cw := &Writer{
		dirFile:     dirFile,
		n:           0,
		crc32:       newCRC32(),
		segmentSize: defaultChunkSegmentSize,
	}
	return cw, nil
}
1350694
func NewReader(r io.Reader) (io.Reader, error) {
	tr, err := fromCp949()
	if err != nil {
		return nil, err
	}

	return &cp949Reader{r: r, tr: tr}, nil
}
1239834
func NewWriter(w io.Writer) *Writer {
	return &Writer{
		Delimiter: '\t',
		UseCRLF:   false,
		w:         bufio.NewWriter(w),
	}
}
640856
func NewByteWriter(buf []byte) (w *ByteWriter) {
	w = new(ByteWriter)
	w.buf = buf
	return w
}
269816
func NewReader(r io.Reader) *Reader {
	return &Reader{
		r:   r,
		ctx: context.Background(),
	}
}
1054277
func NewWriter(rc io.WriteCloser) io.WriteCloser {
	return bufWriteCloser{bufio.NewWriter(rc), rc}
}
79926
func NewLeveledWriter(standard io.Writer, overrides map[Level]io.Writer) *LeveledWriter {
	return &LeveledWriter{
		standard:  standard,
		overrides: overrides,
	}
}
39705
func NewWriter(addr string) (*Writer, error) {
	var err error
	w := new(Writer)
	w.CompressionLevel = flate.BestSpeed

	if w.conn, err = net.Dial("udp", addr); err != nil {
		return nil, err
	}
	if w.hostname, err = os.Hostname(); err != nil {
		return nil, err
	}

	w.Facility = path.Base(os.Args[0])

	return w, nil
}
904073
func NewWriter(fs ...WriterFunc) *Writer {
	return &Writer{
		buffer: &bytes.Buffer{},
		fs:     fs,
	}
}
550441
func NewReader(in io.Reader) (*Reader, error) {
	r := new(Reader)
	r.r.source = in
	r.r.seeker, _ = in.(io.Seeker)
	if err := r.init(); err != nil {
		return nil, err
	}
	return r, nil
}
285577
func NewReader(r io.Reader, bo binary.ByteOrder) Reader {
	return &reader{
		r:  r,
		bo: bo,
	}
}
1063108
func NewWriter(w io.Writer, limiter Limiter) io.Writer {
	return &writer{w, limiter}
}
203562
func NewWriter(w io.Writer, wc int) *Writer {
	bg, _ := NewWriterLevel(w, gzip.DefaultCompression, wc)
	return bg
}