简体   繁体   中英

Buffering stream of byte array

I am using DropNet library to download files from Dropbox.

public Stream GetFileStream(string path)
    {
        return new MemoryStream(dropboxClient.GetFile(path));
    }

I am facing a problem in downloading large files because DropNet library returns byte array then I convert that byte array to stream for another logical purposes using MemoryStream which is not good because I have to download files to server memory then complete my logic I am trying to find a way to buffer that files as a stream.

I looked at BufferedStream Class but to create new buffersteam it requires a stream first. I can't figure the best solution for my problem.

The DropNet API does not expose a Stream functionality for retrieving files. You must wait for the entire file to be downloaded before you can use it. If you want to be able to read the stream as it comes in you will need to use a different library, modify an existing one, or write your own .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM