Skip to content

Commit 244a86f

Browse files
committed
Treat bytes as unsigned bytes
1 parent 9445af9 commit 244a86f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

util/src/main/java/io/kubernetes/client/PortForward.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public void init() throws IOException {
138138
InputStream is = handler.getInputStream(i);
139139
byte[] data = new byte[2];
140140
is.read(data);
141-
int port = data[0] + data[1] * 256;
141+
int port = (data[0] & 0xFF) + (data[1] & 0xFF) * 256;
142142
streams.put(port, i);
143143
}
144144
}

0 commit comments

Comments
 (0)