FAQ

On Wednesday, August 15, 2012 7:20:12 PM UTC+8, Vladimir Mihailenco wrote:
- ReadLine reads data into existing (bufio.Reader.buf) slice until it
founds '\r\n'.
- ReadN reads data into existing slice until it reads N bytes.
- Both ReadLine and ReadN may return ErrBufferFull if buffer is too small.
- Read reads data into existing buffer and than copies data into another
buffer (provided by user). It uses 2 buffers and involves 1 copy call.
There is case when it reads directly to user buffer.

I don't understand why there is so much confusion, but obviously I can't
explain things properly.
I'm also requiring more API from the bufio package, with the goal to avoid
unnecessary copy from the internal buffer of bufio.Reader to a user
provided buffer.

I guess your key point for this API is to avoid the copy, which is not
stated very clear.

I'll just fork the bufio package and see how the new API is going to be
used. If it goes well, maybe I'll raise this request again later.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 20, '13 at 6:07a
activeFeb 20, '13 at 6:07a
posts1
users1
websitegolang.org

1 user in discussion

Chen Yufei: 1 post

People

Translate

site design / logo © 2021 Grokbase