提交 353b2d77 authored 作者: Thomas Mueller's avatar Thomas Mueller

File system abstraction: if used directly, some file systems did not work…

File system abstraction: if used directly, some file systems did not work correctly with spliced byte buffers (the database engine doesn't use those).
上级 bcfc3f08
...@@ -80,7 +80,7 @@ public class FilePathCache extends FilePathWrapper { ...@@ -80,7 +80,7 @@ public class FilePathCache extends FilePathWrapper {
long pos = cachePos; long pos = cachePos;
while (true) { while (true) {
int read = base.read(buff, pos); int read = base.read(buff, pos);
if (read < 0) { if (read <= 0) {
break; break;
} }
if (buff.remaining() == 0) { if (buff.remaining() == 0) {
...@@ -92,7 +92,7 @@ public class FilePathCache extends FilePathWrapper { ...@@ -92,7 +92,7 @@ public class FilePathCache extends FilePathWrapper {
if (read == CACHE_BLOCK_SIZE) { if (read == CACHE_BLOCK_SIZE) {
cache.put(cachePos, buff); cache.put(cachePos, buff);
} else { } else {
if (read < 0) { if (read <= 0) {
return -1; return -1;
} }
len = Math.min(len, read - off); len = Math.min(len, read - off);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论