Atitit.android播放smb 网络邻居视频文件解决方案

Atitit.协议的转换smb2http 原理

 

1. 协议的转换原理 stream的转换..

2. 常用协议转换的情形

 

android通过SMB访问局域网共享文件  

 

作者::  (attilax)>>> 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 ) 汉字名:艾龙,  EMAIL:1466519819@qq.com

转载请注明来源: http://blog.csdn.net/attilax

 

 

3. code

 

 

 package com.attilax.util;

 

import java.io.IOException;

import java.io.InputStream;

import java.io.OutputStream;

 

public class StreamUtil {

byte[] buffer = new byte[524288];

public   void convertStream(InputStream in, OutputStream out) {

// InputStream in = new FileInputStream(srcFile);

// out = new FileOutputStream(destFile);

 

int byteread;

 

byteread = read(in);

 

while (byteread != -1) {

if (byteread != 0) {

try {

out.write(buffer, 0, byteread);

System.out.println("---out.write.."+byteread);

//out.flush();

} catch (Exception e) {

e.printStackTrace();

throw new RuntimeException(e);

}

}

byteread = read(in);

 

}

 

 

try {

in.close();

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

try {

out.close();

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

 

private   int read(InputStream in ) {

int byteread;

try {

byteread = in.read(buffer,0,524288);

} catch (Exception e) {

e.printStackTrace();

byteread = 0;

}

return byteread;

}

 

}

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值