Skip to content

Commit e3cc2b3

Browse files
committed
Fixed Websocket implementation
1 parent b615c8f commit e3cc2b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/javawebstack/http/router/undertow/StreamSourceInputStream.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ public StreamSourceInputStream(StreamSourceChannel source) {
1616
}
1717

1818
public synchronized int read() throws IOException {
19-
byteBuffer.position(0);
19+
((java.nio.Buffer) byteBuffer).position(0);
2020
int r;
2121
while ((r = source.read(byteBuffer)) == 0)
2222
Thread.yield();
2323
if(r == -1)
2424
return -1;
25-
byteBuffer.position(0);
26-
return byteBuffer.get();
25+
((java.nio.Buffer) byteBuffer).position(0);
26+
return byteBuffer.get() & 0xFF;
2727
}
2828

2929
}

0 commit comments

Comments
 (0)