Using byte[] instead of stream