什么是SambaFileInputStream和的FileInputStream之间有什么不同? [英] What's different between SambaFileInputStream and FileInputStream?
问题描述
我需要从流samba服务器的视频,我用nanohttpd在我的项目中创建简单的服务器。当我使用的FileInputStream从我的本地文件,该videoview是由工作组来播放视频的http://本地主机:8080
I need to streaming video from samba server, and I use nanohttpd to create simple server in my project. When I use fileinputstream from my local file, the videoview is work to play video by set "http://localhost:8080"
public class Server extends NanoHTTPD {
public Server() {
super(8080);
}
@Override
public Response serve(String uri, Method method,
Map<String, String> header, Map<String, String> parameters,
Map<String, String> files) {
fis = new FileInputStream(filePath);
return new NanoHTTPD.Response(Status.OK,"video/mp4", fis);
}
}
JCIFS不具备的FileInputStream,所以我只得到smbfileinputstream,当我改变
JCIFS don't have fileinputstream, so I only get smbfileinputstream, when I change
fis = new SmbFile(filePath,auth).getInputStream();
这是行不通的,我需要知道什么是的FileInputStream和smbfileinputsteam之间是不同的,这样我可以从流桑巴视频......
it doesn't work, I need to know what's different between fileinputstream and smbfileinputsteam so that I can streaming video from samba ...
如果您哈瓦其他的解决方案,从桑巴android上的视频流,请帮我...
非常感谢。
If you hava others solution to streaming video from samba on android, please help me...
Thanks a lot..
推荐答案
您可以直接获得来自sbmFile输入流写入的smbfileinputstream
You can write the smbfileinputstream directly by getting the input stream from sbmFile
SmbFileInputStream inputStream = new SmbFileInputStream(smbFile);
//My write logic with inputStream
writeStream(inputStream);
这篇关于什么是SambaFileInputStream和的FileInputStream之间有什么不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!