1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-06-29 06:54:52 +02:00

Fix erroneous cast from byte to int in IBBInputStream's read()

method. The casted value needs to be masked with 0xff, because bytes
in java are signed (two's complement)

Fixes SMACK-394

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13387 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Florian Schmaus 2013-01-05 12:53:45 +00:00 committed by flow
parent e4621df621
commit cd15d7499d

View file

@ -287,7 +287,7 @@ public class InBandBytestreamSession implements BytestreamSession {
}
// return byte and increment buffer pointer
return (int) buffer[bufferPointer++];
return ((int) buffer[bufferPointer++]) & 0xff;
}
public synchronized int read(byte[] b, int off, int len) throws IOException {