20110607_强制类型转换

来源:互联网 发布:婴儿和尚服品牌知乎 编辑:程序博客网 时间:2024/06/16 03:07
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
using System.IO;

#region
//收缩转换,long to int
//扩展转换,int to long
#endregion

namespace _20110607_强制类型转换 {
class Program {
static void Main(string[] args) {
FileStream fs = File.Create("importdata.txt");
byte[] buf2 = new byte[fs.Length];
if (fs.Length <= int.MaxValue) {
int k = fs.Read(buf2, 0, (int)fs.Length);
}
}
}
}

原创粉丝点击