FAQ

On Thu, Sep 3, 2015 at 10:21 PM, WALID BELRHALMIA wrote:
a wired question : about this function

func (b *Reader) Buffered() int

normally this function return the size of the buffer
It's not that size of the buffer, it's the number of bytes currently
in the buffer.
And look now to this code :

file, err := os.Open("fuck.text")
bufferedReader := bufio.NewReader(file)
fmt.Println(bufferedReader.Buffered())

normally the size of the buffer most be the defaukt size 4096 bytes but i
Buffered function return me 0 .
It's zero because you haven't read any bytes yet. So no bytes from the
file have yet been read in to the buffer.

--
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/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 5 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedSep 3, '15 at 12:22p
activeSep 3, '15 at 12:58p
posts5
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase