提交 203d3813 authored 作者: Thomas Mueller's avatar Thomas Mueller

Spellcheck.

上级 77005aa7
...@@ -394,24 +394,24 @@ public class TcpServerThread implements Runnable { ...@@ -394,24 +394,24 @@ public class TcpServerThread implements Runnable {
} }
case SessionRemote.LOB_READ: { case SessionRemote.LOB_READ: {
long lobId = transfer.readLong(); long lobId = transfer.readLong();
CachedInputStream cin = lobs.get(lobId); CachedInputStream in = lobs.get(lobId);
if (cin == null) { if (in == null) {
throw DbException.get(ErrorCode.OBJECT_CLOSED); throw DbException.get(ErrorCode.OBJECT_CLOSED);
} }
long offset = transfer.readLong(); long offset = transfer.readLong();
if (cin.getPos() != offset) { if (in.getPos() != offset) {
LobStorage lobStorage = session.getDataHandler().getLobStorage(); LobStorage lobStorage = session.getDataHandler().getLobStorage();
InputStream in = lobStorage.getInputStream(lobId, -1); InputStream lobIn = lobStorage.getInputStream(lobId, -1);
cin = new CachedInputStream(in); in = new CachedInputStream(lobIn);
lobs.put(lobId, cin); lobs.put(lobId, in);
in.skip(offset); lobIn.skip(offset);
} }
int length = transfer.readInt(); int length = transfer.readInt();
// limit the buffer size // limit the buffer size
length = Math.min(16 * Constants.IO_BUFFER_SIZE, length); length = Math.min(16 * Constants.IO_BUFFER_SIZE, length);
transfer.writeInt(SessionRemote.STATUS_OK); transfer.writeInt(SessionRemote.STATUS_OK);
byte[] buff = new byte[length]; byte[] buff = new byte[length];
length = IOUtils.readFully(cin, buff, 0, length); length = IOUtils.readFully(in, buff, 0, length);
transfer.writeInt(length); transfer.writeInt(length);
transfer.writeBytes(buff, 0, length); transfer.writeBytes(buff, 0, length);
transfer.flush(); transfer.flush();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论