小编dt_*_*ash的帖子

无法正确读取FileStream到byte []

我有一些C#代码可以调用TF(true,"C:\input.txt","C:\noexistsyet.file"),但是当我运行它时,它会将FileStream.Read()文件的最后一个块读入缓冲区,获得索引越界ArgumentException.

对我来说,代码看似合乎逻辑,没有溢出试图写入缓冲区.我原本以为所有的设置与rdlen和_chunk,但也许我看是错误的.有帮助吗?

我的错误: ArgumentException was unhandled: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.

public static bool TF(bool tf, string filepath, string output)
    {
        long _chunk = 16 * 1024; //buffer count
        long total_size = 0
        long rdlen = 0;
        long wrlen = 0;
        long full_chunks = 0;
        long end_remain_buf_len …
Run Code Online (Sandbox Code Playgroud)

c# arrays io byte filestream

2
推荐指数
1
解决办法
2888
查看次数

如何在lua中找到正弦^ -1(正弦反转)

我只需要一个能给我反转正弦的函数.我尝试过使用math.sin(x)^ - 1但这不起作用......你怎么在lua中找到一个数字的倒置正弦?

math lua trigonometry inverse invert

0
推荐指数
1
解决办法
1492
查看次数

标签 统计

arrays ×1

byte ×1

c# ×1

filestream ×1

inverse ×1

invert ×1

io ×1

lua ×1

math ×1

trigonometry ×1