You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openjdk version "11.0.10" 2021-01-19 LTS
OpenJDK Runtime Environment Zulu11.45+28-SA (build 11.0.10+9-LTS)
OpenJDK 64-Bit Server VM Zulu11.45+28-SA (build 11.0.10+9-LTS, mixed mode)
OS type/version
Tested on macOS 12.6.1 (though this is likely a OS-agnostic issue)
Description
In Jetty 9, reading any unsigned byte from 0 to 255 inclusive using the InputStream#read() API against the InputStream instance injected by Jetty into the method annotated with @OnWebSocketMessage for class annotated with @WebSocket worked well.
However, in Jetty 10, attempting to read an unsigned byte in the range 128 to 255 inclusive using the same setup fails since values in this range are returned as signed bytes (-128 to -1, inclusive), which breaks the InputStream#read()contract.
This is causing a problem for us when we use DataOutputStream / DataInputStream to write / read shorts (for example) using Jetty's WebSocket OutputStream / InputStream, since the signed byte returned by Jetty is interpreted as EOF.
Jetty version(s)
10.0.12
Java version/vendor
(use: java -version)
OS type/version
Tested on
macOS 12.6.1
(though this is likely a OS-agnostic issue)Description
In Jetty 9, reading any unsigned byte from 0 to 255 inclusive using the
InputStream#read()
API against theInputStream
instance injected by Jetty into the method annotated with@OnWebSocketMessage
for class annotated with@WebSocket
worked well.However, in Jetty 10, attempting to read an unsigned byte in the range 128 to 255 inclusive using the same setup fails since values in this range are returned as signed bytes (-128 to -1, inclusive), which breaks the
InputStream#read()
contract.This is causing a problem for us when we use
DataOutputStream
/DataInputStream
to write / read shorts (for example) using Jetty's WebSocketOutputStream
/InputStream
, since the signed byte returned by Jetty is interpreted asEOF
.How to reproduce?
See: https://github.com/jspechts/IGN-6520-JETTY-SSCCE
The text was updated successfully, but these errors were encountered: