Skip to content

Commit

Permalink
[signing] Buffer input when using PGP
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Feb 17, 2022
1 parent 47bfd6b commit 0767a62
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,10 @@ private static void sign(JReleaserContext context, PGPSignatureGenerator signatu

FileInputStream in = new FileInputStream(input.toFile());

int ch;
while ((ch = in.read()) >= 0) {
signatureGenerator.update((byte) ch);
byte[] buffer = new byte[8192];
int length = 0;
while ((length = in.read(buffer)) >= 0) {
signatureGenerator.update(buffer, 0, length);
}

signatureGenerator.generate().encode(bOut);
Expand Down

0 comments on commit 0767a62

Please sign in to comment.