Block until all UUID bytes are read or EOF

This commit is contained in:
Ehren Kret 2021-08-03 15:53:14 -07:00
parent 1dda015c6a
commit becf6afbdd
1 changed files with 2 additions and 2 deletions

View File

@ -78,13 +78,13 @@ public class MultiRecipientMessageProvider implements MessageBodyReader<MultiRec
private UUID readUuid(InputStream stream) throws IOException {
byte[] buffer = new byte[8];
int read = stream.read(buffer);
int read = stream.readNBytes(buffer, 0, 8);
if (read != 8) {
throw new IOException("Insufficient bytes for UUID");
}
long msb = convertNetworkByteOrderToLong(buffer);
read = stream.read(buffer);
read = stream.readNBytes(buffer, 0, 8);
if (read != 8) {
throw new IOException("Insufficient bytes for UUID");
}