Skip to content

Commit 70550fd

Browse files
committed
Fix issue gwhalin#70
1 parent 4092496 commit 70550fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/schooner/MemCached/SockInputStream.java

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ public SockInputStream(final SchoonerSockIO sock, int limit) throws IOException
8585
this.sock = sock;
8686
willRead(limit);
8787
sock.readBuf.clear();
88-
sock.getChannel().read(sock.readBuf);
88+
ReadableByteChannel wrappedChannel = Channels.newChannel(sock.getChannel().socket().getInputStream());
89+
wrappedChannel.read(sock.readBuf);
8990
sock.readBuf.flip();
9091
}
9192

@@ -115,7 +116,7 @@ public final int read() throws IOException {
115116
}
116117
count++;
117118
/*
118-
* a potencial bug for read int or read long.
119+
* a potential bug for read int or read long.
119120
*/
120121
return (b & 0xff);
121122
}
@@ -128,7 +129,6 @@ public final int read() throws IOException {
128129
*/
129130
private final void readFromChannel() throws IOException {
130131
sock.readBuf.clear();
131-
// sock.getChannel().read(sock.readBuf);
132132
ReadableByteChannel wrappedChannel = Channels.newChannel(sock.getChannel().socket().getInputStream());
133133
wrappedChannel.read(sock.readBuf);
134134
sock.readBuf.flip();

0 commit comments

Comments
 (0)