implemented utility generator function to read from streams using a buffer
using new utility stream reader function when copying avatar