Skip to main content

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 reader until an error or EOF, and stops the associated timer. This function is useful for consuming the entire content of an input stream while also managing a timer for the read operation.

Parameters

NameTypeDescription
rio.ReaderThe input source from which to read all bytes.
tTimerThe timer to be stopped once the read operation is complete, regardless of success or failure.

Returns

TypeDescription
[]byte, errorThe bytes read from the reader and an error, if any occurred during the read operation.