zoukankan      html  css  js  c++  java
  • 读取二进制字段内容代码

     BinaryWriter bw;
                int bufferSize = 1024;
                byte[] outbyte = new byte[bufferSize];
                long retval;
                long startIndex = 0;
                MemoryStream ms = new MemoryStream();
                           
                bw = new BinaryWriter(ms);
                startIndex = 0;
                retval = reader.GetBytes(reader.GetOrdinal("MapContent"), startIndex, outbyte, 0, bufferSize);
                while (retval == bufferSize)
                {
                    bw.Write(outbyte);
                    bw.Flush();
                    startIndex += bufferSize;

                    if (startIndex < model.MapSize)
                        retval = reader.GetBytes(reader.GetOrdinal("MapContent"), startIndex, outbyte, 0, bufferSize);
                    else
                        break;
                }

                bw.Write(outbyte);
                bw.Flush();
                model.MapContent = ms.ToArray();

  • 相关阅读:
    暂存。2
    暂存。
    dom兼容性问题3 元素操作
    一个查看Access数据库密码的工具
    解除IIS配置节锁定
    解决cef中title不现实tooltip的问题
    创建.symlnk文件
    查询orcale运行的SQL语句记录
    跨域http头
    C#抓取天气数据
  • 原文地址:https://www.cnblogs.com/xiaoko/p/1342011.html
Copyright © 2011-2022 走看看