Esempio n. 1
0
    // Pulls a blob from a specified container with a specified content name
    public string PullBlob(string containerName, string blobName)
    {
        string          rawData;
        HttpWebResponse response    = BlobHelper.GetBlob(containerName, blobName);
        Stream          inputStream = response.GetResponseStream();
        StreamReader    reader      = new StreamReader(inputStream);

        rawData = reader.ReadToEnd();
        reader.Close();
        return(rawData);
    }
Esempio n. 2
0
    /// <summary> Retrieve a single replay that is chosen to be replayed </summary>
    public Replay RetrieveReplay(string replayID)
    {
        Replay          replayReturn;
        string          rawData;
        HttpWebResponse response    = blobHelper.GetBlob(m_CurrentContainer, replayID);
        Stream          inputStream = response.GetResponseStream();
        StreamReader    reader      = new StreamReader(inputStream);

        rawData = reader.ReadToEnd();
        byte[]       bin = Convert.FromBase64String(rawData);
        FileStream   fs  = File.Create(Application.persistentDataPath + "/TempData.dat");
        BinaryWriter bw  = new BinaryWriter(fs);

        bw.Write(bin);
        fs.Close();
        FileStream      fs2 = File.Open(Application.persistentDataPath + "/TempData.dat", FileMode.Open);
        BinaryFormatter bf  = new BinaryFormatter();

        replayReturn = (Replay)bf.Deserialize(fs2);
        fs2.Close();
        File.Delete(Application.persistentDataPath + "/TempData.dat");
        return(replayReturn);
    }