// New created a circle buffered writer that wraps the given writer. The
// bufferSize is the amount of data that will be stored in memory before
// overwriting.
341506
func New(w io.Writer, bufferSize int64) io.WriteCloser {
	buf, _ := circbuf.NewBuffer(bufferSize)
	c := &circbufWriter{
		buf:     buf,
		wr:      w,
		flushCh: make(chan struct{}, 1),
	}
	go c.flushLoop()
	return c
}
1145708
func NewBuffer(f Format) *Buffer {
	return &Buffer{f: f, tmp: make([]byte, f.Width())}
}
1153749
func New(w io.Writer, sep string, l int) io.Writer {
	return &writer{
		Sep: sep,
		Len: l,
		w: w,
	}
}
1013953
func (w *bufferedWriter) createNewWriter(file *os.File) io.Writer {
	w.buf = bufio.NewWriterSize(file, w.bufSize)
	return w.buf
}
852905
func NewWriter() *BytesWriter {
	w := &BytesWriter{}
	w.writer = bytes.NewBuffer(w.buffer)
	return w
}
74136
func (session *Session) BufferSize(size int) *Session {
	session.statement.bufferSize = size
	return session
}
874015
func New(r *uid.Range, factory allocator.AllocatorFactory) *Allocator {
	return &Allocator{
		r:     r,
		alloc: factory(int(r.Size()), r.String()),
	}
}
75397
func New() *Splitter {
	s := &Splitter{
		buffer: []byte{},
		output: make(chan []byte, 1000),
		done:   false, // Explicit declaration though default
	}

	go s.analyze()

	return s
}
1350944
func New() (m *MultipartStreamer) {
	m = &MultipartStreamer{bodyBuffer: new(bytes.Buffer)}

	m.bodyWriter = multipart.NewWriter(m.bodyBuffer)
	boundary := m.bodyWriter.Boundary()
	m.ContentType = "multipart/form-data; boundary=" + boundary

	closeBoundary := fmt.Sprintf("\r\n--%s--\r\n", boundary)
	m.closeBuffer = bytes.NewBufferString(closeBoundary)

	return
}
857336
func New(page, size int) Page {
	if page < 0 {
		page = 1
	}

	if size <= 0 || size > MaxPageSize {
		size = DefaultPageSize
	}

	return Page{Page: page, Size: size}
}
1056646
func New(w io.Writer, n int64) io.Writer {
	return &limitWriter{
		w: w,
		n: n,
	}
}
896527
func NewBuffer() Buffer {
	b := buffer{
		observers: make(map[BufferObserver]bool),
	}
	b.SerializedBuffer.init(&rebalancingNode{})
	r := &b
	runtime.SetFinalizer(r, func(b *buffer) { b.Close() })

	return r
}
1220345
func NewBufferAttr() *BufferAttr {
	return &BufferAttr{
		Maxlength: ^uint32(0),
		Tlength:   ^uint32(0),
		Prebuf:    ^uint32(0),
		Minreq:    ^uint32(0),
		Fragsize:  ^uint32(0),
	}
}
1281692
func New() *Writer {
	termWidth, _ = getTermSize()
	if termWidth != 0 {
		overFlowHandled = true
	}

	return &Writer{
		Out:             Out,
		RefreshInterval: RefreshInterval,

		mtx: &sync.Mutex{},
	}
}
92255
func (c *Conn) BufferSize() int {
	if c.laddr.Buffered() {
		c.buf.configMu.RLock()
		defer c.buf.configMu.RUnlock()
		return c.buf.max
	}
	return 0
}
412498
func NewBufferFrom(p []byte) *Buffer {
	buf := NewBuffer(len(p))
	buf.Write(p)
	zero(p, len(p))
	return buf
}
404805
func New(buffer, backing sorted.KeyValue, maxBufferBytes int64) *KeyValue {
	return &KeyValue{
		buf:       buffer,
		back:      backing,
		maxBuffer: maxBufferBytes,
	}
}