• 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;

    }

     

    }

     

  • 相关阅读:
    Bug
    [转]C# 向web网站GET、POST 数据
    使用JavaScript触发ASP.NET Validator验证
    Asp.net 布尔运算符
    HTML 后退功能JS
    [转]C# 获取硬盘序列号 Volume Serial Number
    ASP.NET中,Gridview如何将源数据中的
    显示成回车

    ASP.NET 验证控件
    与或非的运算法则
    [转]WinForm开发,窗体显示和窗体传值相关知识总结
  • 原文地址:https://www.cnblogs.com/attilax/p/5963424.html
Copyright © 2020-2023  润新知