Skip to content

Commit

Permalink
Replaced the deprecated NullOutputStream fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ebourg committed Jan 30, 2024
1 parent ac6b4bd commit e7c2d84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jsign-core/src/main/java/net/jsign/appx/APPXFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,17 @@ public byte[] computeDigest(DigestAlgorithm digestAlgorithm) throws IOException

// digest the [ContentTypes].xml file
MessageDigest axct = digestAlgorithm.getMessageDigest();
IOUtils.copy(getInputStream("[Content_Types].xml"), new DigestOutputStream(NullOutputStream.NULL_OUTPUT_STREAM, axct));
IOUtils.copy(getInputStream("[Content_Types].xml"), new DigestOutputStream(NullOutputStream.INSTANCE, axct));

// digest the AppxBlockMap.xml file
MessageDigest axbm = digestAlgorithm.getMessageDigest();
IOUtils.copy(getInputStream("AppxBlockMap.xml"), new DigestOutputStream(NullOutputStream.NULL_OUTPUT_STREAM, axbm));
IOUtils.copy(getInputStream("AppxBlockMap.xml"), new DigestOutputStream(NullOutputStream.INSTANCE, axbm));

// digest the AppxMetadata/CodeIntegrity.cat file if present
MessageDigest axci = null;
if (centralDirectory.entries.containsKey("AppxMetadata/CodeIntegrity.cat")) {
axci = digestAlgorithm.getMessageDigest();
IOUtils.copy(getInputStream("AppxMetadata/CodeIntegrity.cat"), new DigestOutputStream(NullOutputStream.NULL_OUTPUT_STREAM, axci));
IOUtils.copy(getInputStream("AppxMetadata/CodeIntegrity.cat"), new DigestOutputStream(NullOutputStream.INSTANCE, axci));
}

ByteArrayOutputStream out = new ByteArrayOutputStream();
Expand Down

0 comments on commit e7c2d84

Please sign in to comment.