mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-26 19:23:19 +01:00
Apparently I'm behind the times on this constructor
// FREEBIE
This commit is contained in:
@@ -244,18 +244,14 @@ public class PubSubConnectionTest {
|
||||
}
|
||||
|
||||
public int read(byte[] input, int offset, int length) {
|
||||
try {
|
||||
int maxCopy = Math.min(data.length - index, length);
|
||||
int randomCopy = SecureRandom.getInstance("SHA1PRNG").nextInt(maxCopy) + 1;
|
||||
int copyAmount = Math.min(maxCopy, randomCopy);
|
||||
int maxCopy = Math.min(data.length - index, length);
|
||||
int randomCopy = new SecureRandom().nextInt(maxCopy) + 1;
|
||||
int copyAmount = Math.min(maxCopy, randomCopy);
|
||||
|
||||
System.arraycopy(data, index, input, offset, copyAmount);
|
||||
index += copyAmount;
|
||||
System.arraycopy(data, index, input, offset, copyAmount);
|
||||
index += copyAmount;
|
||||
|
||||
return copyAmount;
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
return copyAmount;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user