// NewLineBuffer Create line buffer which sends specified receiver of lines and uses the given limit producer
NewLineBuffer Create line buffer which sends specified receiver of lines and uses the given limit producer
// NewLineBuffer Create line buffer which sends specified receiver of lines and uses the given limit producer
func NewLineBuffer(lineReceiver func([]byte), limitProducer func() int) io.Writer {
	if lineReceiver == nil {
		lineReceiver = func([]byte) {}
	}
	if limitProducer == nil {
		limitProducer = func() int { return -1 }
	}
	buffer := &limitedBuffer{}
	buffer.setLimit(limitProducer())
	return &lineBuffer{
		buffer:        buffer,
		lineReceiver:  lineReceiver,
		limitProducer: limitProducer,
	}
}
func NewLineBuffer ( lineReceiver func ( [ ] byte ) , limitProducer func ( ) int ) io . Writer { if lineReceiver == nil { lineReceiver = func ( [ ] byte ) { } } if limitProducer == nil { limitProducer = func ( ) int { return - 1 } } buffer := & limitedBuffer { } buffer . setLimit ( limitProducer ( ) ) return & lineBuffer { buffer : buffer , lineReceiver : lineReceiver , limitProducer : limitProducer , } }
NewLineBuffer Create line buffer which sends specified receiver of lines and uses the given limit producer
NewLineBuffer Create line buffer which sends specified receiver of lines and uses the given limit producer