Sniff()

Synopsis:

#include <aoi.h>

int64_t (*Sniff)(void *ctx,
                 void *buf,
                 int64_t num);

Arguments:

ctx
The context for the stream you want to read from.
buf
The buffer into which you want to put read bytes.
num
The number of bytes to be read from the beginning of the stream.

Description:

This function should nondestructively read num bytes from the beginning of a stream. All streamers should implement this function. Once stream data is read with Read(), you can no longer use Sniff().

Returns:

The number of bytes successfully sniffed from the stream.