gpt4 book ai didi

java - 下载到内存后如何访问文件,Firebase?

转载 作者:行者123 更新时间:2023-12-01 18:41:46 24 4
gpt4 key购买 nike

我已经为 downloading Firebase Storage file to memory 实现了以下代码。所以,下一步是我要访问该文件。在这种情况下我怎样才能实现这一目标?

 //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...");
}
});

最佳答案

您想如何访问该文件?默认情况下,您可以使用new ByteArrayOutputStream()作为存储。 https://stackoverflow.com/a/17595282/6916890

关于java - 下载到内存后如何访问文件,Firebase?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59919139/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com