Block until all UUID bytes are read or EOF
This commit is contained in:
parent
1dda015c6a
commit
becf6afbdd
|
@ -78,13 +78,13 @@ public class MultiRecipientMessageProvider implements MessageBodyReader<MultiRec
|
||||||
private UUID readUuid(InputStream stream) throws IOException {
|
private UUID readUuid(InputStream stream) throws IOException {
|
||||||
byte[] buffer = new byte[8];
|
byte[] buffer = new byte[8];
|
||||||
|
|
||||||
int read = stream.read(buffer);
|
int read = stream.readNBytes(buffer, 0, 8);
|
||||||
if (read != 8) {
|
if (read != 8) {
|
||||||
throw new IOException("Insufficient bytes for UUID");
|
throw new IOException("Insufficient bytes for UUID");
|
||||||
}
|
}
|
||||||
long msb = convertNetworkByteOrderToLong(buffer);
|
long msb = convertNetworkByteOrderToLong(buffer);
|
||||||
|
|
||||||
read = stream.read(buffer);
|
read = stream.readNBytes(buffer, 0, 8);
|
||||||
if (read != 8) {
|
if (read != 8) {
|
||||||
throw new IOException("Insufficient bytes for UUID");
|
throw new IOException("Insufficient bytes for UUID");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue