Changed stream to bytes.
Added embedded resource handling.