|
|
|
|
|
by mbrumlow
398 days ago
|
|
What? Where else would it be? It’s either in the socket(and likely not fully arrived) or … in a buffer. Peak is not some magic, it is well a temporary buffer. Beyond that, I keep seeing people ask for a byte interface. Has anybody looked at the IO.reader interface ??? type Reader interface {
Read(p []byte) (n int, err error)
} You can read as little or as much as you would like and you can do this at any stage of a chain if readers. |
|
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.