FAQ
I use func Copy(dst Writer <https://golang.org/pkg/io/#Writer>, src Reader
<https://golang.org/pkg/io/#Reader>) (written int64
<https://golang.org/pkg/builtin/#int64>, err error
<https://golang.org/pkg/builtin/#error>) for reading the response body into
Writer.
Should LimitedReader or bufio should be used instead?

--
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

  • Kiki Sugiaman at Dec 4, 2015 at 7:46 am
    If you are worried that io.Copy will load your large data entirely into
    memory, it won't.
    LimitedReader and bufio are wrappers containing more functionalities. I
    wouldn't worry about them if io.Copy already does what you need to do.

    --
    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.
  • Prajakta Dandawate at Dec 4, 2015 at 7:37 pm
    Thank you for you reply.
    On Thursday, December 3, 2015 at 11:46:46 PM UTC-8, ksug wrote:

    If you are worried that io.Copy will load your large data entirely into
    memory, it won't.
    LimitedReader and bufio are wrappers containing more functionalities. I
    wouldn't worry about them if io.Copy already does what you need to do.
    --
    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.
  • Tim K at Dec 4, 2015 at 8:06 pm
    There's also io.CopyBuffer if you want to provide your own buffer of a
    specific size. io.Copy uses a 32K buffer it allocates. It may be easier to
    use than wrapping in a bufio.Reader which uses a 4K buffer by default.

    On Friday, December 4, 2015 at 11:38:13 AM UTC-8, prajakta....@gmail.com
    wrote:
    Thank you for you reply.
    On Thursday, December 3, 2015 at 11:46:46 PM UTC-8, ksug wrote:

    If you are worried that io.Copy will load your large data entirely into
    memory, it won't.
    LimitedReader and bufio are wrappers containing more functionalities. I
    wouldn't worry about them if io.Copy already does what you need to do.
    --
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 4, '15 at 1:18a
activeDec 4, '15 at 8:06p
posts4
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase