'How to access file after Downloading to Memory, Firebase?
I have implemented the code below for downloading Firebase Storage file to memory. So, the next step is I want to access the file. How can I achieve that in this case?
//Download to memory
public void downloadToMemory(StorageReference sRefChild, String selectedFile)
{
final long ONE_MEGABYTE = 1024 * 1024 *5;
sRefChild.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener<byte[]>() {
@Override
public void onSuccess(byte[] bytes) {
System.out.println("On success!");
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle any errors
System.out.println("Handle failure...");
}
});
Solution 1:[1]
How do you want to access the file?
By default you may use new ByteArrayOutputStream() as a storage.
https://stackoverflow.com/a/17595282/6916890
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | lazylead |
