|
|
|
|
|
by nemothekid
398 days ago
|
|
You are still doing a copy, and people want to avoid the needless memory copy. If you are decoding a 4 megabyte jpeg, and that jpeg already exists in memory, then copying that buffer by using the Reader interface is painful overhead. |
|
In this context, you can either have the io.Reader do a copy without allocating anything (take in a slice managed by the caller), or allocate and return a slice. There isn't really a middle ground here.