mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-23 11:27:57 +01:00
Move finalization of signatures into own method
This commit is contained in:
parent
bed18dc0ad
commit
31c4570d10
1 changed files with 8 additions and 6 deletions
|
@ -67,9 +67,7 @@ public abstract class SignatureInputStream extends FilterInputStream {
|
||||||
final int data = super.read();
|
final int data = super.read();
|
||||||
final boolean endOfStream = data == -1;
|
final boolean endOfStream = data == -1;
|
||||||
if (endOfStream) {
|
if (endOfStream) {
|
||||||
parseAndCombineSignatures();
|
finalizeSignatures();
|
||||||
verifyOnePassSignatures();
|
|
||||||
verifyDetachedSignatures();
|
|
||||||
} else {
|
} else {
|
||||||
byte b = (byte) data;
|
byte b = (byte) data;
|
||||||
updateOnePassSignatures(b);
|
updateOnePassSignatures(b);
|
||||||
|
@ -84,9 +82,7 @@ public abstract class SignatureInputStream extends FilterInputStream {
|
||||||
|
|
||||||
final boolean endOfStream = read == -1;
|
final boolean endOfStream = read == -1;
|
||||||
if (endOfStream) {
|
if (endOfStream) {
|
||||||
parseAndCombineSignatures();
|
finalizeSignatures();
|
||||||
verifyOnePassSignatures();
|
|
||||||
verifyDetachedSignatures();
|
|
||||||
} else {
|
} else {
|
||||||
updateOnePassSignatures(b, off, read);
|
updateOnePassSignatures(b, off, read);
|
||||||
updateDetachedSignatures(b, off, read);
|
updateDetachedSignatures(b, off, read);
|
||||||
|
@ -94,6 +90,12 @@ public abstract class SignatureInputStream extends FilterInputStream {
|
||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void finalizeSignatures() {
|
||||||
|
parseAndCombineSignatures();
|
||||||
|
verifyOnePassSignatures();
|
||||||
|
verifyDetachedSignatures();
|
||||||
|
}
|
||||||
|
|
||||||
public void parseAndCombineSignatures() {
|
public void parseAndCombineSignatures() {
|
||||||
if (objectFactory == null) {
|
if (objectFactory == null) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue