ReadAll
Reads all bytes from an io.Reader and stops a provided Timer.
def ReadAll(
r: io.Reader,
t: Timer
) - > []byte, error
Reads all bytes from the provided io.Reader until EOF and stops the associated timer. This function is useful for consuming the entire content of a reader and measuring the duration of the read operation.
Parameters
| Name | Type | Description |
|---|---|---|
| r | io.Reader | The source from which to read all bytes until EOF. |
| t | Timer | The timer to stop once the read operation is complete, used for measuring the duration of the read. |
Returns
| Type | Description |
|---|---|
[]byte, error | The content read from the reader as a byte slice, and an error if the read operation fails. |