The exact mechanism for creating a stream depends upon the source for that particular stream, but typically it will involve a call to a creation function, such as fz_open_file.
Alternative functions exist to allow creating streams from C level FILE pointers:
from direct memory blocks:
and from fz_buffers:
There are too many other options for creating streams to list them all here, but their use should be self evident from the header file definitions. Once created, all streams can be used in the same ways.