Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Unity Multiplayer Sending a stream to a client [Solved]

Discussion in 'Multiplayer' started by Megolas, Jun 22, 2015.

  1. Megolas


    Apr 6, 2013
    I'm currently trying to send a FileStream to a NetworkClient, and I wondered if there is another way to do it other than reading the stream several times into byte[] and sending the byte[] in a NetworkWriter.
    Is there a better way to do it, preferably one that doesn't require me to connect the arrays (They are already sequenced)?

    EDIT: Solved.

    I just StartMessage and write from a buffer to the writer. The buffer reads from the stream.
    Last edited: Jun 22, 2015