On 2014-01-17 19:24, Brad Fitzpatrick wrote:
> Assume an io.Reader is hooked up to a satellite dish receiving a message
> (maybe a 1TB message) from an alien civilization who only transmits
> their message once every thousand years.
>
> There's no "rewinding" that.
>
> If you want a copy, you need to copy it as you read it, perhaps to disk
> or memory, depending on its size.
>
> io.TeeReader + bytes.Buffer is a common approach.
>
>
Yes, seems to be black-out day, this works of course
buf, _ := ioutil.ReadAll(mdjsonreader)
minimaljsonbuffer := bytes.NewBuffer(buf)
mdjson := bytes.NewBuffer(buf)
>