What is the difference between 'getBytes()' and 'getStream()' methods in Firebase Storage?

Viewed 522

I am relatively new to the field of development and I am trying to learn firebase Storage. There are some methods named getStream and getBytes. Can some one help me understand what are there specific use cases. Thanks.

1 Answers

There's documentation available. It says for both: Asynchronously downloads the object, one time you receive it as a stream, the other as an array of bytes, but with getBytes A byte array will be allocated large enough to hold the entire file in memory. Therefore, using this method will impact memory usage of your process. If you are downloading many large files, getStream(StreamDownloadTask.StreamProcessor) may be a better option.

Related