提交 d2be5823 编写于 作者: A Andrey Bykiev

Fix

上级 d20d9401
......@@ -310,8 +310,8 @@ public NPOIFSFileSystem(Stream stream)
data.Write(headerBuffer.Buffer);
data.Position = headerBuffer.Length;
//IOUtils.ReadFully(channel, data);
data.Position += IOUtils.ReadFully(channel, data.Buffer, data.Position, (int)channel.Length);
//IOUtils.ReadFully(channel, data.Buffer);
data.Position += IOUtils.ReadFully(channel, data.Buffer, data.Position, (int)maxSize);
success = true;
// Turn it into a DataSource
......
......@@ -195,8 +195,8 @@ public static int ReadFully(Stream stream, byte[] b, int off, int len)
int total = 0;
while (true)
{
int got = stream.Read(b, off + total, len - total);
if (got < 0)
int got = stream.Read(b, off + total, len - total - off);
if (got <= 0)
{
return (total == 0) ? -1 : total;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册